Method for inducing prediction motion vector and apparatuses using same

ABSTRACT

Disclosed are a method for inducing a prediction motion vector and an apparatus using the same. An image decoding method can include: a step of determining the information related to a plurality of spatial candidate prediction motion vectors from peripheral predicted blocks of a predicted target block; and a step of determining the information related to temporal candidate prediction motion vectors on the basis of the information related to the plurality of spatial candidate prediction motion vectors. Accordingly, the present invention can reduce complexity and can enhance coding efficiency when inducing the optimum prediction motion vector.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. patent application Ser. No.14/344,105 filed on Mar. 13, 2014, which is a National Stage applicationof International Application No. PCT/KR2012/007388, filed Sep. 14, 2012and published as WO 2013/039356 A2, on Mar. 21, 2013, which claimsbenefit under 35 U.S.C. §119(a) of Korean Patent Application Nos.10-2011-0093564, filed on Sep. 16, 2011, 10-2011-0106108, filed on Oct.17, 2011, 10-2012-0005916, filed on Jan. 18, 2012, and 10-2012-0102214,filed on Sep. 14, 2012, in the Korean Intellectual Property Office, thecontents of all of which are incorporated herein by reference in theirentireties

TECHNICAL FIELD

The present invention is directed to a decoding method and apparatus,and more specifically to a method of inducing prediction motion vectorand an apparatus using the same.

BACKGROUND ART

Demand of high-resolution, high-quality videos, such as HD (HighDefinition) videos or UHD (Ultra High Definition) videos, is on the risein various application industries. As video data has higher resolutionand higher quality, the amount of data relatively increases compared toexisting video data. Accordingly, when the existing wired/wirelesswideband circuit lines are used to transmit such video data or existingstorage media are used to store the video data, transmission and storagecosts increase. To address such problems that occur as the video datahas higher resolution and higher quality, high-efficiency videocompression technologies may be utilized.

There are various types of video compression technologies. Among others,inter-prediction predicts pixel values included in a current picturefrom the previous or subsequent picture of the current picture,intra-prediction predicts pixel values included in the current pictureusing pixel information in the current picture, and entropy encodingassigns a shorter code to a more frequent value while assigning a longercode to a less frequent value. Such video compression technologies maybe used to effectively compress, transmit, or store video data.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method of configuringa candidate prediction motion vector list for increasing videoencoding/decoding efficiency.

Another object of the present invention is to provide an apparatus thatperforms a method of configuring a candidate prediction motion vectorlist for increasing video encoding/decoding efficiency.

Technical Solution

To achieve the above objects, according to an aspect of the presentinvention, a method of configuring a candidate prediction motion vectorlist may include the steps of determining information regarding aplurality of spatial candidate prediction motion vectors from anadjacent prediction block of a prediction target block and determininginformation regarding a temporal candidate prediction motion vectorbased on the information regarding the plurality of spatial candidateprediction motion vectors.

The information regarding the plurality of spatial candidate predictionmotion vectors may include at least one of spatial candidate predictionmotion vector availability information indicating whether a spatialcandidate prediction motion vector is induced and the spatial candidateprediction motion vector, and the information regarding the temporalcandidate prediction motion vector may include at least one of temporalcandidate prediction motion vector availability information indicatingwhether a temporal candidate prediction motion vector is induced and thetemporal candidate prediction motion vector.

The step of determining the information regarding the plurality ofspatial candidate prediction motion vectors from the adjacent predictionblock of the prediction target block may include the steps ofdetermining first spatial candidate prediction motion vectoravailability information and a first spatial candidate prediction motionvector and determining second spatial candidate prediction motion vectoravailability information and a second spatial candidate predictionmotion vector.

The step of determining the information regarding the temporal candidateprediction motion vector based on the plurality of spatial candidateprediction motion vectors and the availability information of theplurality of spatial candidate prediction motion vectors may include thesteps of, based on the first spatial candidate prediction motion vectoravailability information, the second spatial candidate prediction motionvector availability information, the first spatial candidate predictionmotion vector, and the second spatial candidate prediction motionvector,

determining whether the first spatial candidate prediction motion vectorand the second spatial candidate prediction motion vector are bothavailable and whether the first spatial candidate prediction motionvector and the second spatial candidate prediction motion vector are thesame as each other or not and, in a case where the first spatialcandidate prediction motion vector and the second spatial candidateprediction motion vector are both available and the first spatialcandidate prediction motion vector and the second spatial candidateprediction motion vector are not the same as each other, determining thetemporal candidate prediction motion vector availability information sothat the temporal candidate prediction motion vector is not available,wherein the information regarding the temporal candidate predictionmotion vector includes at least one of the temporal candidate predictionmotion vector availability information and the temporal candidateprediction motion vector.

The step of determining the information regarding the temporal candidateprediction motion vector based on the plurality of spatial candidateprediction motion vectors and the availability information of theplurality of spatial candidate prediction motion vectors may include thesteps of, based on the first spatial candidate prediction motion vectoravailability information, the second spatial candidate prediction motionvector availability information, the first spatial candidate predictionmotion vector, and the second spatial candidate prediction motionvector,

determining whether the first spatial candidate prediction motion vectorand the second spatial candidate prediction motion vector are bothavailable and whether the first spatial candidate prediction motionvector and the second spatial candidate prediction motion vector are thesame as each other or not, and, in a case where at least one of thefirst spatial candidate prediction motion vector and the second spatialcandidate prediction motion vector is not available or in a case wherethe first spatial candidate prediction motion vector and the secondspatial candidate prediction motion vector are both available and thefirst spatial candidate prediction motion vector and the second spatialcandidate prediction motion vector are the same as each other,performing a process of inducing the information regarding the temporalcandidate prediction motion vector to determine the informationregarding the temporal candidate prediction motion vector, wherein theinformation regarding the temporal candidate prediction motion vectorincludes at least one of the temporal candidate prediction motion vectoravailability information and the temporal candidate prediction motionvector.

The candidate prediction motion vector list may include the firstspatial candidate prediction motion vector in a case where the firstspatial candidate prediction motion vector is available based on thefirst spatial candidate prediction motion vector availabilityinformation, the second spatial candidate prediction motion vector in acase where the second spatial candidate prediction motion vector isavailable based on the second spatial candidate prediction motion vectoravailability information, and the temporal candidate prediction motionvector in a case where the temporal candidate prediction motion vectoris available based on the temporal candidate prediction motion vectoravailability information, wherein the information regarding the temporalcandidate prediction motion vector includes at least one of the temporalcandidate prediction motion vector availability information and thetemporal candidate prediction motion vector.

The method may further include the step of removing the second spatialcandidate prediction motion vector from the candidate prediction motionvector list in a case where the first spatial candidate predictionmotion vector and the second spatial candidate prediction motion vectorincluded in the candidate prediction motion vector list are the same aseach other.

The method may further include the steps of determining whether thenumber of candidate prediction motion vectors included in the candidateprediction motion vector list is smaller than the maximum number of thecandidate prediction motion vectors that may be included in thecandidate prediction motion vector list and adding or removing acandidate prediction motion vector to/from the candidate predictionmotion vector list based on a result of the determination.

The step of adding or removing the candidate prediction motion vectorto/from the candidate prediction motion vector list based on the resultof the determination may include the steps of, in a case where thenumber of the candidate prediction motion vectors included in thecandidate prediction motion vector list is smaller than the maximumnumber of the candidate prediction motion vectors, adding a zero vectorto the candidate prediction motion vector list and, in a case where thenumber of the candidate prediction motion vectors included in thecandidate prediction motion vector list is equal to or larger than themaximum number of the candidate prediction motion vectors, removing someof the candidate prediction motion vectors from the candidate predictionmotion vector list so that as many candidate prediction motion vectorsas the maximum number of the candidate prediction motion vectors areincluded in the candidate prediction motion vector list.

The first spatial candidate prediction motion vector availabilityinformation may be produced by the steps of determining whether a firstmotion vector is available in a first block or a second block includedin a first spatial candidate prediction block group, in a case where thefirst motion vector is not available in the first block or the secondblock included in the first spatial candidate prediction block group,determining whether a second motion vector is available in the firstblock and the second block of the first spatial candidate predictionblock group, in a case where the first motion vector or the secondmotion vector is not available in the first block or the second blockincluded in the first spatial candidate prediction block group,determining whether a third motion vector is available in the firstblock and the second block of the first spatial candidate predictionblock group, and in a case where the first motion vector, the secondmotion vector, or the third motion vector is not available in the firstblock or the second block included in the first spatial candidateprediction block group, determining whether a fourth motion vector isavailable in the first block and the second block of the first spatialcandidate prediction block group.

The second spatial candidate prediction motion vector availabilityinformation may be produced by the steps of determining whether a firstmotion vector is available in a third block, a fourth block, or a fifthblock included in a second spatial candidate prediction block group, ina case where the first motion vector is not available in the thirdblock, the fourth block, or the fifth block included in the secondspatial candidate prediction block group, determining whether a secondmotion vector is available in the third block, the fourth block, or thefifth block of the second spatial candidate prediction block group, in acase where the first motion vector or the second motion vector is notavailable in the third block, the fourth block, or the fifth blockincluded in the second spatial candidate prediction block group,determining whether a third motion vector is available in the thirdblock, the fourth block, or the fifth block of the second spatialcandidate prediction block group, and in a case where the first motionvector, the second motion vector, or the third motion vector is notavailable in the third block, the fourth block, or the fifth blockincluded in the second spatial candidate prediction block group,determining whether a fourth motion vector is available in the thirdblock, the fourth block, or the fifth block of the second spatialcandidate prediction block group.

To achieve the above objects, according to another aspect of the presentinvention, an video decoding apparatus may include an entropy decodingunit that decodes information regarding a prediction motion vector usedfor performing inter prediction for a prediction target block amongcandidate prediction motion vectors included in a candidate predictionmotion vector list and a prediction unit that determines informationregarding a plurality of spatial candidate prediction motion vectorsfrom an adjacent prediction block of a prediction target block anddetermines information regarding a temporal candidate prediction motionvector based on the information regarding the plurality of spatialcandidate prediction motion vectors to generate the candidate predictionmotion vector list.

The information regarding the plurality of spatial candidate predictionmotion vectors may include at least one of spatial candidate predictionmotion vector availability information and the spatial candidateprediction motion vector, and the information regarding the temporalcandidate prediction motion vector may include at least one of temporalcandidate prediction motion vector availability information and thetemporal candidate prediction motion vector.

The information regarding the plurality of spatial candidate predictionmotion vectors may be at least one of first spatial candidate predictionmotion vector availability information and a first spatial candidateprediction motion vector and at least one of second spatial candidateprediction motion vector availability information and a second spatialcandidate prediction motion vector.

The information regarding the temporal candidate prediction motionvector may include at least one of temporal candidate prediction motionvector availability information and a temporal candidate predictionmotion vector, and in a case where the first spatial candidateprediction motion vector and the second spatial candidate predictionmotion vector are both available and the first spatial candidateprediction motion vector and the second spatial candidate predictionmotion vector are not the same as each other, the temporal candidateprediction motion vector availability information may be determined sothat the temporal candidate prediction motion vector is not available.

In a case where at least one of the first spatial candidate predictionmotion vector and the second spatial candidate prediction motion vectoris not available or in a case where the first spatial candidateprediction motion vector and the second spatial candidate predictionmotion vector are both available and the first spatial candidateprediction motion vector and the second spatial candidate predictionmotion vector are the same as each other, the information regarding thetemporal candidate prediction motion vector may be determined byperforming a process of inducing the information regarding the temporalcandidate prediction motion vector, wherein the information regardingthe temporal candidate prediction motion vector may include at least oneof the temporal candidate prediction motion vector availabilityinformation and the temporal candidate prediction motion vector.

The candidate prediction motion vector list may include the firstspatial candidate prediction motion vector in a case where the firstspatial candidate prediction motion vector is available based on thefirst spatial candidate prediction motion vector availabilityinformation, the second spatial candidate prediction motion vector in acase where the second spatial candidate prediction motion vector isavailable based on the second spatial candidate prediction motion vectoravailability information, and the temporal candidate prediction motionvector in a case where the temporal candidate prediction motion vectoris available based on the temporal candidate prediction motion vectoravailability information, wherein the information regarding the temporalcandidate prediction motion vector may include at least one of thetemporal candidate prediction motion vector availability information andthe temporal candidate prediction motion vector.

The candidate prediction motion vector list may be reconfigured byremoving the second candidate prediction motion vector in a case wherethe first spatial candidate prediction motion vector is the same as thesecond spatial candidate prediction motion vector.

The candidate prediction motion vector list may be reconfigured bydetermining whether the number of candidate prediction motion vectorsincluded in the candidate prediction motion vector list is smaller thanthe maximum number of the candidate prediction motion vectors that maybe included in the candidate prediction motion vector list and adding orremoving a candidate prediction motion vector to/from the candidateprediction motion vector list based on a result of the determination.

The candidate prediction motion vector list may be reconfigured by, in acase where the number of the candidate prediction motion vectorsincluded in the candidate prediction motion vector list is smaller thanthe maximum number of the candidate prediction motion vectors, adding azero vector to the candidate prediction motion vector list, and, in acase where the number of the candidate prediction motion vectorsincluded in the candidate prediction motion vector list is equal to orlarger than the maximum number of the candidate prediction motionvectors, removing some of the candidate prediction motion vectors fromthe candidate prediction motion vector list so that as many candidateprediction motion vectors as the maximum number of the candidateprediction motion vectors are included in the candidate predictionmotion vector list.

Advantageous Effects

As described above, the method of configuring a motion vector list andan apparatus using the method according to an embodiment of the presentinvention are directed to a method of configuring a candidate predictionmotion vector list and calculating a prediction motion vector, and themethod and apparatus may reduce complexity that occurs upon inducing theoptimal prediction motion vector and may raise encoding efficiency.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a configuration of an videoencoding apparatus according to an embodiment of the present invention.

FIG. 2 is a block diagram illustrating a configuration of an videodecoding apparatus according to another embodiment of the presentinvention.

FIG. 3 is a concept view illustrating spatial candidate predictionblocks and temporal candidate prediction blocks to produce a candidateprediction motion vector according to an embodiment of the presentinvention.

FIG. 4 is a concept view illustrating a method of classifying motionvectors of spatial candidate prediction blocks through a relationshipbetween the motion vector of the prediction target block and the motionvector of the spatial candidate prediction block according to anembodiment of the present invention.

FIG. 5 is a flowchart illustrating a method of producing a candidateprediction motion vector according to an embodiment of the presentinvention.

FIG. 6 is a flowchart illustrating a method of producing a candidateprediction motion vector according to another embodiment of the presentinvention.

FIG. 7 is a flowchart illustrating a method of producing a candidateprediction motion vector according to still another embodiment of thepresent invention.

FIG. 8 is a flowchart illustrating a process of producing an additionalcandidate prediction motion vector according to an embodiment of thepresent invention.

FIG. 9 is a flowchart illustrating a method of producing an additionalcandidate prediction motion vector according to another embodiment ofthe present invention.

FIG. 10 is a flowchart illustrating a method of producing a predictionmotion vector according to an embodiment of the present invention.

FIG. 11 is a flowchart illustrating a method of producing a predictionmotion vector according to another embodiment of the present invention.

FIG. 12 is a flowchart illustrating a method of producing a predictionmotion vector according to an embodiment of the present invention.

FIG. 13 is a flowchart illustrating a method of producing a predictionmotion vector according to another embodiment of the present invention.

FIG. 14 is a flowchart illustrating a method of producing a candidateprediction motion vector according to an embodiment of the presentinvention.

FIG. 15 is a conceptual view illustrating a method of producing atemporal candidate prediction motion vector according to an embodimentof the present invention.

FIG. 16 is a conceptual view illustrating a method of producing acandidate prediction motion vector list according to an embodiment ofthe present invention.

FIG. 17 is a conceptual view illustrating removing the same candidateprediction motion vector from the candidate prediction motion vectorlist according to an embodiment of the present invention.

FIG. 18 is a conceptual view illustrating a method of adjusting the sizeof the candidate prediction motion vector list by adding or removing thecandidate prediction motion vector according to an embodiment of thepresent invention.

FIG. 19 is a conceptual view illustrating determining the finalprediction motion vector in the candidate prediction motion vector listaccording to an embodiment of the present invention.

FIG. 20 is a flowchart illustrating a method of producing a candidateprediction motion vector list according to an embodiment of the presentinvention.

BEST MODE

Hereinafter, embodiments of the present invention will be described indetail with reference to the accompanying drawings. In describing theembodiments, when determined to make the gist of the invention unclear,the detailed description on the well-known configurations or functionswill be omitted.

When a component is “connected to” or “coupled to” another component,the component may be directly connected or coupled to the othercomponent, or other components may also intervene. Further, when aspecific component is “included”, other components are not excluded butmay be included, and such configuration is also included in the scope ofthe invention.

The terms “first” and “second” may be used to describe variouscomponents, but the components are not limited thereto. These terms areused only to distinguish one component from another. For example, thefirst component may be also named the second component, and the secondcomponent may be similarly named the first component.

The constitutional parts in the embodiments are independently shown torepresent different features, but this does not mean that eachconstitutional part is formed of a separate hardware unit or onesoftware constitutional unit. That is, each constitutional part isseparated from the others for ease of description. At least two of theconstitutional parts may be combined into a single constitutional part,or one constitutional part may be divided into a plurality ofconstitutional parts which may perform functions, respectively. Theembodiments covering the combinations of the constitutional parts or theseparation thereof may be included in the scope of the invention withoutdeparting from the gist of the invention.

Some constitutional parts are not essential ones to perform theinevitable functions of the present invention but rather may be optionalconstitutional parts to enhance performance. The present invention maybe implemented only by the constitutional parts necessary for realizingthe gist of the invention or such a configuration that includes only theessential constitutional parts excluding the optional constitutionalparts used for enhancing performance may also be included in the scopeof the present invention.

FIG. 1 is a block diagram illustrating a configuration of an videoencoding apparatus according to an embodiment of the present invention.

Referring to FIG. 1, the video encoding apparatus 100 includes a motionprediction unit 111, a motion compensation unit 112, an intra predictionunit 120, a switch 115, a subtractor 125, a transformer 130, a quantizer140, an entropy encoding unit 150, an inverse-quantizer 160, aninverse-transformer 170, an adder 175, a filter unit 180, and areference picture buffer 190.

The video encoding apparatus 100 performs encoding in an intra mode orin an inter mode and outputs a bit stream. In case of the intra mode,the switch 115 switches to ‘intra’, and in case of the inter mode, theswitch 115 switches to ‘inter’. The video encoding apparatus 100produces a prediction block for an input block of an input picture andthen encodes a residual of the input block and the prediction block.

In case of the intra mode, the intra prediction unit 120 may produce theprediction block by performing spatial prediction using a pixel value ofan already encoded block adjacent of a current block.

In case of the inter mode, the motion prediction unit 111 may obtain amotion vector by finding a region that matches best an input block in areference picture stored in the reference picture buffer 190 during themotion prediction process. The motion compensation unit 112 may producethe prediction block by performing motion compensation using the motionvector.

The motion prediction unit 111 may generate a candidate predictionmotion vector list based on a plurality of spatial candidate predictionmotion vectors induced from an adjacent prediction block of a predictiontarget block and information relating to a temporal candidate predictionmotion vector determined based on information on the plurality ofspatial candidate prediction motion vectors. A method of generating thecandidate prediction motion vector list will be described below indetail, and the prediction unit that performs such operation is includedin the embodiments of the present invention.

The subtractor 125 may produce a residual block by subtracting of theinput block and the produced prediction block. The transformer 130performs transform on the residual block to output a transformcoefficient. Here, the transform coefficient may mean a coefficientvalue that is obtained by performing transform on the residual blockand/or residual signal. Hereinafter, as used herein, a quantizedtransform coefficient level that is obtained by applying quantization tothe transform coefficient may also be referred to as transformcoefficient.

The quantizer 140 quantizes the input transform coefficient according toa quantization parameter to output the quantized transform coefficientlevel.

The entropy encoding unit 150 performs entropy encoding based on thevalues obtained by the quantizer 140 or encoding parameters obtainedduring the encoding to output a bit stream.

When the entropy encoding applies, symbols are represented so that fewerbits are assigned to a symbol that has a high occurrence probability,and more bits are assigned to a symbol that has a low occurrenceprobability, and thus, the size of bit stream for symbols to be encodedmay be reduced. Accordingly, the entropy encoding may increasecompression performance of the video encoding. The entropy encoding unit150 may use encoding schemes, such as exponential golomb, CAVLC(Context-Adaptive Variable Length Coding), or CABAC (Context-AdaptiveBinary Arithmetic Coding), for entropy encoding.

The entropy encoding unit 150 may encode information on the predictionmotion vector used to perform inter prediction for the prediction targetblock among candidate prediction motion vectors included in thecandidate prediction motion vector list.

Since the video encoding apparatus shown in FIG. 1 performs interprediction encoding, i.e., inter-frame prediction encoding, thecurrently encoded picture needs to be decoded and stored so that thecurrently encoded picture may be used as a reference picture.Accordingly, the quantized coefficient is inverse-quantized by theinverse-quantizer 160, and inverse-transformed by theinverse-transformer 170. The inverse-quantized, inverse-transformedcoefficient is added to the prediction block by the adder 175, and areconstructed block is then produced.

The reconstructed block goes through the filter unit 180 that applies atleast one or more of a deblocking filter, SAO (Sample Adaptive Offset),and ALF (Adaptive Loop Filter) to the reconstructed block orreconstructed picture. After passing through the filter unit 180, thereconstructed block may be stored in the reference picture buffer 190.

FIG. 2 is a block diagram illustrating a configuration of an videodecoding apparatus according to another embodiment of the presentinvention.

Referring to FIG. 2, the video decoding apparatus 200 includes anentropy decoding unit 210, an inverse-quantizer 220, aninverse-transformer 230, an intra prediction unit 240, a motioncompensation unit 250, an adder 255, a filter unit 260, and a referencepicture buffer 270.

The video decoding apparatus 200 receives the bit stream output from theencoder and decodes the bit stream in the intra mode or in the intermode to thereby output a reconstructed picture, i.e., decoded picture.In case of the intra mode, the switch shifts to ‘intra’, and in case ofthe inter mode, the switch shifts to ‘inter’. The video decodingapparatus 200 may obtain a reconstructed residual block from thereceived bit stream, may produce a prediction block, and may add thereconstructed residual block to the prediction block to thereby producethe reconstructed block, i.e., the decoded block.

The entropy decoding unit 210 entropy decodes the received bit streamaccording to a probability distribution to produce symbols includingquantized coefficient-type symbols. The entropy decoding scheme issimilar to the above-described entropy encoding scheme.

When the entropy decoding scheme applies, symbols are represented sothat fewer bits are assigned to the symbols having a higher probabilityof occurrence, and more bits are assigned to symbols having a lowerprobability of occurrence, and thus, the size of the bit stream for eachsymbol may be reduced. Accordingly, the video decoding compressionperformance may be increased by the entropy decoding scheme.

The entropy decoding unit 210 may decode information on the predictionmotion vector used for performing inter-frame prediction on a predictiontarget block among candidate prediction motion vectors included in thecandidate prediction motion vector list.

The quantized coefficient may be inverse-quantized by theinverse-quantizer 220, inverse-transformed by the inverse-transformer230, and as a result of inverse-quantization/inverse-transform, areconstructed residual block may be produced.

In case of the intra mode, the intra prediction unit 240 may produce aprediction block by performing spatial prediction using a pixel value ofan already decoded block adjacent to the current block. In case of theinter mode, the motion compensation unit 250 may perform motioncompensation using the reference picture stored in the reference picturebuffer 270 and the motion vector to thereby produce the predictionblock.

In case of the inter mode, a candidate prediction motion vector list maybe generated based on a plurality of spatial candidate prediction motionvectors induced from an adjacent prediction block of a prediction targetblock and information relating to a temporal candidate prediction motionvector determined based on information on the plurality of spatialcandidate prediction motion vectors. A method of generating thecandidate prediction motion vector list will be described below indetail, and the decoding apparatus including the prediction unit thatperforms such operation is included in the embodiments of the presentinvention.

The reconstructed residual block and the prediction block are added toeach other by the adder 255, and the added blocks may go through thefilter unit 260. The filter unit 260 may apply at least one or more of adeblocking filter, SAO, and ALF to the reconstructed block orreconstructed picture. The filter unit 260 may output the reconstructedpicture, i.e., the decoded picture. The reconstructed picture is storedin the reference picture buffer 270 and may be used for inter mode.

To enhance prediction performance of the encoding/decoding apparatuses,there are a method of elevating accuracy of the interpolation pictureand a method of predicting a difference signal. Here, the “differencesignal” may be, depending on the context, referred to as “residualsignal”, “residual block”, or “differential block”, which may bedistinguished from each other by those skilled in the art within thescope of not affecting the scope or gist of the invention.

As described above, although for ease of description the coding unit ishereinafter used as a unit in which encoding is performed, the codingunit may be also a unit in which decoding as well as encoding isperformed. Further, the “unit” or “block” hereinafter refers to a unitin which video encoding and decoding are performed, and the “encoding ordecoding unit” when video encoding and decoding are performed refers toa unit that is obtained by splitting one picture for encoding ordecoding. Thus, the encoding or decoding unit may be also referred to as“macroblock”, “coding unit (CU)”, “prediction unit (PU)”, “transformunit (TU)”, or “transform block”. One block may be split into smallersubblocks. The prediction unit is a basic block for performingprediction/compensation, and the prediction unit may be split to aplurality of partitions. The plurality of partitions may be a basicblock for performing prediction, and the partition obtained by splittingthe prediction unit is also referred to as the prediction unit.

The video encoding method and video decoding method to be describedbelow according to embodiments of the present invention may be performedby each component included in the video encoding apparatus and videodecoding apparatus described above in connection with FIGS. 1 and 2.Each component may be implemented in hardware and also may include aprocessing unit implemented in software, which may be executed throughan algorithm.

FIG. 3 is a concept view illustrating spatial candidate predictionblocks and temporal candidate prediction blocks to produce a candidateprediction motion vector according to an embodiment of the presentinvention.

The position of a pixel positioned at the upper and left end of aprediction target block is defined as (xP, yP), the width of theprediction target block is defined as nPSW, and the height of theprediction target block is defined as nPSH. MinPuSize may refer to thesize of the smallest prediction block.

Hereinafter, according to an embodiment of the present invention, as thespatial adjacent prediction blocks of the prediction target block, ablock including a pixel positioned at (xP−1, yP+nPSH) is defined as aleft first block (A0 block, 300), and a block including a pixelpositioned at (xP−1, yP+nPSH−MinPuSize) is defined as a left secondblock (A1 block, 310). A block including a pixel positioned at (xP+nPSW,yP−1) is defined as an upper first block (B0 block, 320), a blockincluding a pixel positioned at (xP+nPSW−MinPuSize, yP−1) is defined asan upper second block (B1 block, 330), and a block including a pixelpositioned at (xP−MinPuSize, yP−1) is defined as an upper third block(B2 block, 340).

The spatial candidate prediction blocks may include the left first block(A0, 300), the left second block (A1, 310), the upper first block (B0,320), the upper second block (B1, 330), and the upper third block (B2,340). The spatial candidate prediction blocks may be divided into twogroups including a first spatial candidate prediction group includingthe left first block 300 and the left second block 310 and a secondspatial candidate prediction group including the upper first block 320,the upper second block 330, and the upper third block 340.

The temporal candidate prediction block 350 is a prediction blockincluding a pixel positioned at (xP+nPSW, yP+nPSH) in the collocatedpicture of the current prediction block based on the pixel position (xP,yP) in the picture including the current prediction target block, or incase the prediction block including the pixel positioned at (xP+nPSW,yP+nPSH) is not available, a prediction block including the pixelpositioned at (xP+(nPSW>>1), yP+(nPSH>>1)). In the collocated picture,the prediction block including the pixel positioned at (xP+nPSW,yP+nPSH) is referred to as the first collocated block, and in thecollocated picture, the prediction block including the pixel positionedat (xP+(nPSW>>1), yP+(nPSH>>1)) is referred to as the second collocatedblock.

The position and number of the spatial candidate prediction blocks andthe position and number of the temporal candidate prediction blocks maybe arbitrarily determined and may vary without departing from the gistof the present invention. Further, the orders of prediction blocksscanned when configuring the candidate prediction motion vector list mayvary as well. That is, the position, number, scanning order, andcandidate prediction group of the candidate prediction blocks used toconfigure the candidate prediction motion vector list described belowmay vary without departing from the gist of the present invention. Atthis time, the candidate prediction motion vector list means a listconsisting of the candidate prediction motion vectors.

FIG. 4 is a concept view illustrating a method of classifying motionvectors of spatial candidate prediction blocks through a relationshipbetween the motion vector of the prediction target block and the motionvector of the spatial candidate prediction block according to anembodiment of the present invention.

Referring to FIG. 4, a motion vector of a spatial candidate predictionblock produced from the same reference frame and the same referencepicture list as the prediction target block is referred to as a firstmotion vector 400. Referring to FIG. 4, assume that the referencepicture of the prediction target block 450 is picture j, and thereference picture list including the picture j is list L0, the referencepicture indicated by the vector 400 of the spatial candidate predictionblock 470 is the picture j, and the reference picture list including thepicture j is list L0, and thus, the motion vector of the spatialcandidate prediction block 470 and the motion vector of the predictiontarget block have the same reference picture and the same referencepicture list. As such, the motion vector produced from the samereference frame and the same list as the prediction target block isdefined as the first motion vector 400.

The motion vector of the spatial candidate prediction block 470 that hasthe same reference frame as the prediction target block 450 and that isproduced from different reference picture lists is referred to as asecond motion vector 410. Assuming that the reference picture of theprediction target block 450 is picture j and the reference picture listincluding the picture j is list L0, the reference picture indicated bythe vector of the spatial candidate prediction block 470 is picture jand the reference picture list including the picture j is list L1, andthus, the motion vector 410 of the spatial candidate prediction blockand the motion vector of the prediction target block have the samereference picture but different reference picture lists. As such, themotion vector that has the same reference frame as the prediction targetblock but that is produced from the different lists is defined as thesecond motion vector 410.

The motion vector of the spatial candidate prediction block that has adifferent reference frame from that of the prediction target block andthat is produced from the same reference picture list is referred to asa third motion vector 420. Assuming that the reference picture of theprediction target block 450 is picture j and the reference picture listincluding the picture j is list L0, the reference picture indicated bythe vector 420 of the spatial candidate prediction block 470 is picturel and the reference picture list including the picture l is list L0, andthus, the motion vector of the spatial candidate prediction block andthe motion vector of the prediction target block have differentreference pictures but the same reference picture list. As such, themotion vector that has a different reference frame from that of theprediction target block 450 but is produced from the same list isdefined as the third motion vector 420. Since the third motion vector420 has a different reference picture from that of the prediction targetblock, when the motion vector of the spatial candidate prediction blockis used, it may be scaled based on the reference picture of theprediction target block and then may be included in the candidateprediction motion vector list.

The motion vector of the spatial candidate prediction block 470 that hasa different reference frame from that of the prediction target block 450and is produced from a different reference picture list is referred toas a fourth motion vector 430. Assuming that the reference picture ofthe prediction target block 450 is picture j and the reference picturelist including picture j is list L0, the reference picture indicated bythe vector 430 of the spatial candidate prediction block 470 is picturem, and the reference picture list including picture m is list L1, themotion vector of the spatial candidate prediction block and the motionvector of the prediction target block have different reference picturesand different reference picture lists. As such, the motion vector thatis produced from a different reference frame and a different referencepicture list from those of the prediction target block is defined as thefourth motion vector 430. The fourth motion vector 430 has a differentreference picture from that of the prediction target block 450, andthus, when the motion vector of the spatial candidate prediction blockis used, it is scaled based on the reference picture of the predictiontarget block and then may be included in the candidate prediction motionvector list.

The motion vector of the spatial candidate prediction block may becategorized into the first motion vector to the fourth motion vectordepending on the reference frame and the reference picture list of theprediction target block as described above. The first motion vector andthe second motion vector are vectors that may be used without scaling,and are defined as non-scaling motion vectors that have not undergonescaling. The third and fourth motion vectors are vectors that may beused without scaling and are defined as scaling-motion vectors.

The method of categorizing the motion vector of the spatial candidateprediction block into the first motion vector to the fourth motionvector may be used to determine which one of the motion vectors of thespatial candidate prediction block is to be first used as the candidateprediction motion vector which is to be described below.

Hereinafter, among the candidate prediction motion vectors, such as thefirst motion vector to the fourth motion vector, the motion vectorselected as the optimal motion vector may be defined as the predictionmotion vector.

FIG. 5 is a flowchart illustrating a method of producing a candidateprediction motion vector according to an embodiment of the presentinvention.

The candidate prediction motion vector conceptually includes at leastone or more of a spatial candidate prediction motion vector and atemporal candidate prediction motion vector.

According to an embodiment of the present invention, in the method ofproducing a candidate prediction motion vector, processes of inducingthe candidate prediction motion vector may be performed in parallel. Forexample, in case that one candidate prediction motion vector is inducedfrom each of two spatial candidate prediction groups (first spatialcandidate prediction group and second spatial candidate predictiongroup) and one candidate prediction motion vector is induced from atemporal candidate prediction block, the operations of inducing thecandidate prediction motion vectors from the first spatial candidateprediction group, the second spatial candidate prediction group, and thetemporal candidate prediction block may be performed in parallel. “theprocesses of inducing the candidate prediction motion vector areperformed in parallel” means that complexity of the process of inducingthe candidate prediction motion vector may be reduced.

Referring to FIG. 5, a step of producing a first spatial candidateprediction motion vector in a first spatial candidate prediction group(step S500), a step of producing a spatial candidate prediction motionvector in a second spatial candidate prediction group (step S520), and astep of producing a temporal candidate prediction motion vector in atemporal candidate prediction block (step S540) are performed inparallel.

The steps of producing the candidate prediction motion vectors performedin parallel as shown in FIG. 5 are arbitrarily defined, and othermethods may be adopted without departing from the gist of the presentinvention that induces the candidate prediction motion vectors inparallel. For example, the step of producing the candidate predictionmotion vector in the temporal candidate prediction block may be omittedwhile the step of producing the candidate prediction motion vector inthe first spatial candidate prediction group and the step of producingthe candidate prediction motion vector in the second spatial candidateprediction group only may be performed in parallel.

In the method of inducing the candidate prediction motion vectoraccording to an embodiment of the present invention,

A) method of using as the candidate prediction motion vector only thenon-scaling motion vectors (first motion vector or second motion vector)that is not subjected to scaling, and

B) method of using as the candidate prediction motion vector the thirdmotion vector or fourth motion vector that is not subjected to scalingin case no non-scaling motion vectors (first motion vector or secondmotion vector) are available may be adopted to produce the candidateprediction motion vector.

FIG. 6 is a flowchart illustrating a method of producing a candidateprediction motion vector according to another embodiment of the presentinvention.

Referring to FIG. 6, it is sequentially determined whether there is anon-scaling motion vector (first motion vector or second motion vector)in order from the left first block to the left second block (step S600).

As described above, the first motion vector and the second motion vectorrefer to non-scaling candidate prediction motion vectors that have thesame reference picture index and do not need to be subjected to scaling.

In step S600, for example, it may be determined in the following orderwhether there is a candidate prediction motion vector:

(1) it is determined whether there is a non-scaling candidate predictionmotion vector in the left first block, and in case there is anon-scaling candidate prediction motion vector in the left first block,the corresponding non-scaling candidate prediction motion vector isdetermined as the candidate prediction motion vector.

(2) in case no non-scaling candidate prediction motion vector isavailable in the left first block, it is determined whether there is anon-scaling candidate prediction motion vector in the left second block.In case there is a non-scaling candidate prediction motion vector in theleft second block, the corresponding non-scaling candidate predictionmotion vector is determined as the candidate prediction motion vector.

(3) in case no non-scaling candidate prediction motion vector is in theleft second block, no candidate prediction motion vector may be producedfrom the first spatial candidate prediction group (left first block andleft second block).

As another example, in step S600, it may be determined in the followingorder whether there is a candidate prediction motion vector:

(1) it is determined whether the first motion vector is in the leftfirst block, and in case there is the first motion vector in the firstblock, the corresponding vector is determined as the candidateprediction motion vector.

(2) in case there is no first motion vector in the left first block, itis determined whether the first motion vector is in the second block,and in case there is the first motion vector in the left second block,the corresponding vector is determined as the candidate predictionmotion vector.

(3) in case there is no first motion vector in the left second block, itis determined whether the second motion vector is in the left firstblock, and in case there is a second motion vector in the left firstblock, the corresponding vector is determined as the candidateprediction motion vector.

(4) in case there is no second motion vector in the left first block, itis determined whether the second motion vector is in the left secondblock, and in case there is the second motion vector in the left secondblock, the corresponding vector is determined as the candidateprediction motion vector.

The above-described order is merely an example of an order in which thenon-scaling candidate prediction motion vector is produced from thefirst spatial candidate prediction group, and in other orders, thenon-scaling candidate prediction motion vector may be produced from thefirst spatial candidate prediction group.

As described above, in case no non-scaling candidate prediction motionvector is available in step S600, the candidate prediction motion vectormay be not produced from the first spatial candidate prediction group(left first block and left second block).

In case there is a non-scaling candidate prediction motion vector in thefirst spatial candidate prediction group through the method of producingthe non-scaling candidate prediction motion vector, first spatialcandidate prediction group availability information (for example,availableFlagLXY) is set as 1 to indicate that there is the candidateprediction motion vector in the first spatial candidate predictiongroup. “1” may be a binary numeral to indicate whether there is thecandidate prediction motion vector, and other binary numerals may beused to indicate the same. In an embodiment of the present invention,binary numerals “1” and “0” which indicate predetermined information arearbitrarily determined, and the corresponding information may berepresented based on codes produced by other binary encoding or decodingmethods.

According to another embodiment, in case no non-scaling candidateprediction motion vector is produced in step S600, it is sequentiallydetermined whether there is the scaling motion vector (third motionvector or fourth motion vector) in the left first block and left secondblock (step S610).

For example, it may be determined by the sub-steps in step S610 whetherthere is the scaling motion vector:

(1) it is sequentially determined whether there is the third motionvector or fourth motion vector in the left first block, and in casethere the third motion vector or fourth motion vector is in the leftfirst block, the third motion vector or fourth motion vector isdetermined as the candidate prediction motion vector without scaling.

(2) in case there is no third motion vector or fourth motion vector inthe left first block, it is sequentially determined whether the thirdmotion vector or fourth motion vector is in the left second block, andin case there is the third motion vector or fourth motion vector in theleft second block, the corresponding third motion vector or fourthmotion vector is determined as the candidate prediction motion vectorwithout scaling.

That is, in case there is no non-scaling candidate prediction motionvector in the first spatial candidate prediction group, the scalingcandidate prediction motion vector (third motion vector or fourth motionvector) is produced from the first spatial candidate prediction group(left first block and left second block), and in such case, the motionvector that has not been subjected to scaling may be produced as thecandidate prediction motion vector.

As the method of sequentially determining whether there is the scalingcandidate prediction motion vector (third motion vector or fourth motionvector) in the left first block and left second block in step S610,various methods, for example, the above-described method of producingthe scaling motion vector (first motion vector or second motion vector)in the left first block and the left second lock, may be adopted, whichare also included in the scope of the present invention.

In case there is a motion vector satisfying the conditions through stepS600 or steps S600 and S610, the first spatial candidate predictiongroup availability information is set as 1, and a process of determiningwhether there is its subsequent motion vector may not be performed.

The same method may apply to the second spatial candidate predictiongroup to produce the candidate prediction motion vector.

It is determined whether there is a non-scaling motion vector in orderof the upper first block, the upper second block, and the upper thirdblock (step S620).

The step S620 of producing the candidate prediction motion vector in thesecond spatial candidate prediction group may be performed in parallelwith at least one of steps S600 and S610 of producing the candidateprediction motion vector in the first spatial candidate prediction groupas described above.

For example, similar to the method described above in connection withstep S600, in step S620, it is determined whether there is the firstmotion vector in order of the upper first block to the upper thirdblock, and in case there is no first motion vector in the upper firstblock to the upper third block, it is determined whether there is thesecond motion vector in order from the upper first block to the upperthird block or it is determined whether there is the first motion vectoror the second motion vector in the upper first block, and then it isdetermined whether there is the first motion vector or the second motionvector in the upper second block, and it is determined whether there isthe first motion vector or the second motion vector in the third block.By such method, the spatial candidate prediction motion vector may beproduced.

The determination processes in step S620 may be performed by variousmethods as in step S600, which are all included in the scope of thepresent invention.

In case there is a candidate prediction motion vector satisfying thecondition in the upper first block to the upper third block based on thesequential determination processes in step S620, its subsequentdetermination process may be skipped. The produced motion vector may beincluded in the candidate prediction motion vector list, and the secondspatial candidate prediction group availability information may be setas 1 to indicate there is the candidate prediction motion vector in thesecond spatial candidate prediction group.

Like in step S600, in case there is no first motion vector or secondmotion vector, which is the non-scaling candidate prediction motionvector, in the upper first block to the upper third block through stepS620, the candidate prediction motion vector may not be produced fromthe second spatial candidate prediction group.

According to another embodiment, in case it is determined in step S620that there is no non-scaling motion vector in the upper first block, theupper second block, and the upper third block, it is determined whetherthere is the scaling motion vector (third motion vector and fourthmotion vector) in the upper first block, the upper second block, and theupper third block.

In case as a result of sequentially determining in step S620 whetherthere is the first motion vector or the second motion vector in orderfrom the upper first block to the upper third block there is no vectorsatisfying the condition, the candidate prediction motion vector may beproduced through step S630.

In case it is determined in step S630 that the third motion vector orthe fourth motion vector is available in at least one of the upper firstblock, the upper second block, and the upper third block, scaling is notperformed on the corresponding vector, and the third motion vector andfourth motion vector, which have not subjected to scaling, may beincluded in the candidate prediction motion vector list.

The process of determining whether there is the third motion vector orthe fourth motion vector in at least one of the upper first block, theupper second block, and the upper third block may be performed byvarious methods, such as the method of producing the motion vector inthe first spatial candidate prediction group.

In case there is a motion vector satisfying the condition through stepsS620 and S630, one candidate prediction motion vector may be producedfrom the second spatial candidate prediction group.

It is determined whether there is a candidate prediction motion vectorin the temporal candidate prediction block (collocated block) (stepS640).

The step S640 of determining whether there is the candidate predictionmotion vector in the temporal candidate prediction block may beperformed in parallel with step S600 or S610 of producing the candidateprediction motion vector in the first spatial candidate prediction groupand step S620 or S630 of producing the candidate prediction motionvector in the second spatial candidate prediction group.

The temporal candidate prediction block may be divided into a firstcollocated block and a second collocated block as described above, andit is determined whether the collocated block is available, and if thefirst collocated block is not available, the second collocated block maybe selected as the collocated block.

Depending on predetermined information, one of the reference pictures inthe reference picture list of the current picture may become thecollocated picture including the temporal candidate prediction block. Inaddition, various methods of producing the collocated picture includingthe temporal candidate prediction block may be used. The temporalcandidate prediction block using two reference picture lists may firstuse as the candidate prediction motion vector only the motion vectorthat is available in one list according to predetermined flaginformation. In case the distance between the current picture and thereference picture of the current picture is different from the distancebetween the picture including the temporal candidate prediction blockand the reference picture of the temporal candidate prediction block,scaling may be performed on the candidate prediction motion vectorproduced in the temporal candidate prediction block.

According to an embodiment of the present invention, no scaling may beperformed on the temporal candidate prediction block (collocated block).For example, in case calculation complexity needs to be reduced, thetemporal candidate prediction block may not be subjected to scaling bynot performing scaling or through a setting method in which no scalingis adaptively performed on the motion vector of the collocated blockthrough flag information.

In case the candidate prediction motion vector produced from thetemporal candidate prediction block may be produced, the temporalcandidate prediction block availability information may be set as 1.

That is, according to an embodiment of the present invention, theprocesses of determining whether there are available candidateprediction motion vectors in the first spatial candidate predictiongroup, the second spatial candidate prediction group, and the temporalcandidate prediction block are performed in parallel to thereby removedependency that occurs when the candidate prediction motion vector isproduced in the first spatial candidate prediction group, the secondspatial candidate prediction group, and the temporal candidateprediction block when producing the candidate prediction motion vector.

Further, in determining whether there are available candidate predictionmotion vectors in the first spatial candidate prediction group, thesecond spatial candidate prediction group, and the temporal candidateprediction block, only the processes of determining in parallel whetherthere are available candidate prediction motion vectors in the firstspatial candidate prediction group and the second spatial candidateprediction group may be performed, while the process of determiningwhether there is a candidate prediction motion vector available in thetemporal candidate prediction block is dependently performed. As such,when producing the candidate prediction motion vectors in the firstspatial candidate prediction group, the second spatial candidateprediction group, and the temporal candidate prediction block, theprocesses of producing the candidate prediction motion vectors only fromat least two of the groups may be performed in parallel.

In case there are motion vectors that may be produced in the firstspatial candidate prediction group, the second spatial candidateprediction group, and the temporal candidate prediction block via theabove-described process, it may be indicated by using availabilityinformation flag (availableFlagLXY or availableFlagCol) that there areavailable candidate prediction motion vectors.

As described above, in producing the candidate prediction motion vector,the number and position of the blocks included in the first spatialcandidate prediction group, the number and position of the blocksincluded in the second spatial candidate prediction group, and thenumber and position of the temporal candidate prediction blocks arearbitrarily determined, and the number and position of the blocksincluded in the first and second spatial candidate prediction groups mayvary, which is also included in the scope of the present invention.

FIG. 7 is a flowchart illustrating a method of producing a candidateprediction motion vector according to still another embodiment of thepresent invention.

According to an embodiment of the present invention, when the candidateprediction motion vectors are induced from the first spatial candidateprediction group and the second spatial candidate prediction group,irrespective of whether scaling has been performed on the motion vectorproduced from a different candidate prediction block, scaling may beindividually performed so that the candidate prediction motion vectormay be induced in parallel.

The candidate prediction motion vector is induced from the first spatialcandidate prediction group (left first block, left second block).

To induce the candidate prediction motion vector from the first spatialcandidate prediction group, it may be determined whether there is anon-scaling motion vector (first motion vector or second motion vector)in the first spatial candidate prediction group (step S700).

The method described above in connection with step S600 may be used todetermine whether there is the non-scaling motion vector (first motionvector or second motion vector) in the first spatial candidateprediction group.

To induce the candidate prediction motion vector in the first spatialcandidate prediction group, it may be determined whether there is thescaling motion vector (third motion vector or fourth motion vector) inthe first spatial candidate prediction group (step S710).

In case it is determined in step S700 that there is no non-scalingmotion vector, it is determined whether there is a scaling motion vector(third motion vector or fourth motion vector), the scaling motion vector(third motion vector or fourth motion vector) may be selected as thecandidate prediction motion vector.

In step S710, various methods, such as the method described inconnection with step S610, may be used to determine whether there is thethird motion vector or the fourth motion vector in the first spatialcandidate prediction group, and in step S710, unlike in step S610,scaling is first performed and the produced third motion vector and thefourth motion vector may be used as the candidate prediction motionvector.

The candidate prediction motion vector is induced from the secondspatial candidate prediction group (upper first block, upper secondblock, and upper third block).

To induce the candidate prediction motion vector in the second spatialcandidate prediction group, it may be determined whether there is anon-scaling motion vector (first motion vector or second motion vector)in the second spatial candidate prediction group (step S720).

The method described above in connection with step S620 may be used todetermine whether there is the non-scaling motion vector (first motionvector or second motion vector) in the second spatial candidateprediction group.

To induce the candidate prediction motion vector in the second spatialcandidate prediction group, it may be determined whether there is thescaling motion vector (third motion vector or fourth motion vector) inthe second spatial candidate prediction group (step S730).

In case it is determined in step S720 that there is no non-scalingmotion vector, the scaling motion vector (third motion vector or fourthmotion vector) may be selected as the candidate prediction motionvector.

It may be determined in step S730 by various methods, such as the methoddescribed above in connection with step S630, whether there is the thirdmotion vector or the fourth motion vector in the second spatialcandidate prediction group, and in step S730, unlike in step S630,scaling is first performed and the produced third motion vector orfourth motion vector may be used as the candidate prediction motionvector.

Scaling may be independently performed on the third motion vector orfourth motion vector produced in the second spatial candidate predictiongroup irrespective of whether scaling has been performed in the firstspatial candidate prediction group to produce the candidate predictionmotion vector.

It is determined whether there is a candidate prediction motion vectorin the temporal candidate prediction block (collocated block) (stepS740).

Step S740 of determining whether there is the candidate predictionmotion vector in the temporal candidate prediction block may beperformed in parallel with step S700 or S710 of producing the candidateprediction motion vector in the first spatial candidate prediction groupand step S720 or S730 of producing the candidate prediction motionvector in the second spatial candidate prediction group.

The temporal candidate prediction block may be divided into a pluralityof candidate prediction blocks, such as the first collocated block andthe second collocated block as described above, and if one temporalcandidate prediction motion vector is produced from the temporalcandidate prediction block, it is determined whether the firstcollocated block is available and if the first collocated block is notavailable, the second collocated block may be selected as the collocatedblock.

According to an embodiment of the present invention, scaling may beindependently performed on the candidate prediction motion vectorproduced from the temporal candidate prediction block withoutdetermining whether scaling has been performed on the candidateprediction motion vector produced from the first spatial candidateprediction group and the candidate prediction motion vector producedfrom the second spatial candidate prediction group. Further, as anothermethod, no scaling may be performed on the temporal candidate predictionblock (collocated block). For example, in case calculation complexityneeds to be reduced, the scaling may not be performed on the temporalcandidate prediction block through a setting method in which no scalingis performed or no scaling is adaptively performed on the motion vectorof the collocated block through flag information. In case there is thecandidate prediction motion vector in the first spatial candidateprediction group, the second spatial candidate prediction group, or thetemporal candidate prediction block through the above process, theavailability information flag (availableFlagLXY or availableFlagCol) maybe used to indicate that there is the candidate prediction motionvector.

As described above in connection with FIG. 6, in producing the candidateprediction motion vector, the number and position of the blocks includedin the first spatial candidate prediction group, the number and positionof the blocks included in the second spatial candidate prediction group,and the number and position of the temporal candidate prediction blocksare arbitrarily determined, and the number and position of the blocksincluded in the first and second spatial candidate prediction groups mayvary, which is also included in the scope of the present invention.

As described in connection with FIG. 7, scaling may be performed on boththe first spatial candidate prediction group and the second spatialcandidate prediction group. According to an embodiment of the presentinvention, however, scaling may be performed on only at least one of thefirst spatial candidate prediction group or the second spatial candidateprediction group.

For example, scaling may be performed only on the first spatialcandidate prediction group. In case scaling is performed only on thefirst spatial candidate prediction group, it is similar to what isdescribed above in connection with FIG. 7. However, in step S730 of FIG.7, to induce the candidate prediction motion vector in the secondspatial candidate prediction group, it is determined whether there is ascaling motion vector (third motion vector or fourth motion vector) inthe second spatial candidate prediction group, and then, withoutperforming scaling on the scaling motion vector (third motion vector orfourth motion vector), the third motion vector or fourth motion vectorwhich has not been subjected to scaling may be used as the candidateprediction motion vector.

In the same way, scaling may be performed only on the second spatialcandidate prediction group. In such case, to induce the candidateprediction motion vector in the first spatial candidate prediction groupin step S710, it is determined whether there is the scaling motionvector (third motion vector or fourth motion vector) in the firstspatial candidate prediction group, and then, without performing scalingon the scaling motion vector (third motion vector or fourth motionvector), the third motion vector or fourth motion vector that has notbeen subjected to scaling may be used as the candidate prediction motionvector.

As another example, predetermined flag information indicating whetherscaling is performed may be used so that scaling may be used at once onthe candidate prediction motion vector. For example, in case scaling isperformed once on the first spatial candidate prediction group, noscaling is done on the second spatial candidate prediction group, and incase no scaling is performed on the first spatial candidate predictiongroup, flag information may be used to indicate whether scaling is doneso that scaling may be used for the second spatial candidate predictiongroup.

FIG. 8 is a flowchart illustrating a process of producing an additionalcandidate prediction motion vector according to an embodiment of thepresent invention.

FIG. 8 discloses a method of adding an additional candidate predictionmotion vector in a candidate prediction motion vector list in case thenumber of candidate prediction motion vectors included in the currentcandidate prediction motion vector list is not the maximum based on thenumber of the candidate prediction motion vectors that may be includedin the candidate prediction motion vector list. The method of adding theadditional candidate prediction motion vector to the candidateprediction motion vector list may be used to enhance encoding efficiencyupon prediction of the motion vector.

Referring to FIG. 8, it is determined whether the number of candidateprediction motion vectors induced from a spatial candidate predictiongroup or a temporal candidate prediction block is smaller than the sizeof candidate prediction motion vector list (step S800).

In case the number of induced candidate prediction motion vectors is thesame as the number of candidate prediction motion vectors that may beincluded in the candidate prediction motion vector list, the inducedcandidate prediction motion vectors only may be included in thecandidate prediction motion vector list and may be used as candidateprediction motion vectors of the prediction target block. Hereinafter,in this embodiment of the present invention, the number of the inducedcandidate prediction motion vectors refers to the number of candidateprediction motion vectors that remain after duplicate candidateprediction motion vectors are removed from the candidate predictionmotion vectors induced from the spatial candidate prediction group andthe temporal candidate prediction block.

In case the number of the induced candidate prediction motion vectors issmaller than the number of the candidate prediction motion vectors thatmay be included in the candidate prediction motion vector list, anadditional candidate prediction motion vector is produced (step S810).

Various methods of producing the additional candidate prediction motionvector, such as a method of performing scaling, a method of using anoffset, or a method of using a statistical result, may be used.Hereinafter, a method of producing an additional candidate predictionmotion vector according to an embodiment of the present invention isdescribed below in detail.

It is determined whether the produced additional candidate predictionmotion vector overlaps the motion vector included in the candidateprediction motion vector list (step S820).

In case the produced additional candidate prediction motion vectoroverlaps the motion vector included in the candidate prediction motionvector list, a new additional candidate prediction motion vector isinduced (step S810).

In case the produced additional candidate prediction motion vector doesnot overlap the motion vector included in the candidate predictionmotion vector list, the produced additional candidate prediction motionvector is included in the candidate prediction motion vector list (stepS830).

FIG. 9 is a flowchart illustrating a method of producing an additionalcandidate prediction motion vector according to another embodiment ofthe present invention.

FIG. 9 illustrates the method of using scaling among the methods ofproducing an additional candidate prediction motion vector as describedabove in connection with step S810.

Referring to FIG. 9, it may be assumed that the spatial candidateprediction block 900 is a prediction block that performs interprediction based on two motion vectors (a motion vector 920 referring toan n−1th picture included in a reference picture list L0 and a motionvector 940 referring to an n+1th picture included in a reference picturelist L1).

Assuming that in producing the candidate prediction motion vector of theprediction target block, among the motion vectors of the upperprediction block, the motion vector 920 referring to the n−1th pictureof the reference picture list L0 is removed from the candidateprediction motion vector list to avoid duplication, and only the motionvector 940 referring to the n+1th picture of the remaining referencepicture list L1 is used as the candidate prediction motion vector, themotion vector 940, which refers to the reference picture list L1 and isnot yet used as the additional candidate prediction motion vector, issubjected to scaling, and the induced motion vector may be used as theadditional candidate prediction motion vector.

That is, scaling is performed on the motion vector referring to then+1th picture in the direction of the reference picture list L1 based onthe distance between the reference picture n−1 included in the list L0of the current prediction block and the n+1th picture in the directionof the reference picture list L1, and a produced motion vector may beincluded in the candidate prediction motion vector list as theadditional candidate prediction motion vector. Such motion vector may bedefined by the term “opposite-direction scaling candidate predictionmotion vector”.

That is, according to an embodiment of the present invention, in casethe candidate prediction motion vector is induced from the predictionblock referring to ref_list[X], X=0 or 1, the motion vector referring toref_list[1−X] is subjected to scaling based on the reference picture ofthe prediction block and may be induced and used as the additionalcandidate prediction motion vector.

As a method of producing the additional candidate prediction motionvector according to another embodiment of the present invention, anoffset-based method may be used.

For example, in case among the candidate prediction motion vectors inthe candidate prediction motion vector list, one candidate predictionmotion vector is {mvp_x, mvp_y}, offsets α and β, respectively, areadded to the X and Y components of the motion vector to thereby inducethe additional candidate prediction motion vector {mvp_x+α, mvp_y+β}.

At this time, the offset value may be transmitted on a per-picturebasis, per-slice basis, per-LCU (largest coding unit) basis, per-CUbasis, or per-PU basis.

The offset value may be produced based on the encoded/decoded motionvector difference (MVD: motion vector difference). Based on a specificpicture unit, a higher priority is assigned to the MVD value that occursmost frequently and it may be used as the offset value. A list of MVDvalues which have priorities in order of most frequent occurrence may beproduced, and in case the number of additional candidate predictionmotion vectors is two or more, the offset is added to the candidateprediction motion vectors in the candidate prediction motion vector listin order of priority so that new candidate prediction motion vectors maybe induced.

A statistical method may be used as the method of producing theadditional candidate prediction motion vector according to anotherembodiment of the present invention.

For example, the motion vectors of the prediction block included in apredetermined slice are arranged in order of frequency of occurrence,and among the arranged motion vectors, at least one vector may be usedas the candidate prediction motion vector of the prediction targetblock. At this time, to reduce complexity, a predetermined limit may beset to restrict the motion vectors, which check whether to occur andfrequency, to a predetermined number.

In producing the additional candidate prediction motion vector, as astatistical method according to another embodiment, the candidateprediction motion vector that occurred most frequently in the alreadyencoded and decoded slice may be used as the additional candidateprediction motion vector.

At this time, since upon occurrence of an error, it is impossible tonormally refer to the motion vector of the encoded/decoded picture orslice in the encoding/decoding target picture or slice, among the motionvectors that have higher frequency of occurrence, at least one or moremay be encoded/decoded in the upper level syntax elements (pictureparameter set, adaptive parameter set, slice header, etc.) in thebitstream.

FIG. 10 is a flowchart illustrating a method of producing a predictionmotion vector according to an embodiment of the present invention.

Hereinafter, the prediction motion vector may be used as the termdefining the motion vector selected as the optimal motion vector amongthe candidate prediction motion vectors.

Referring to FIG. 10, it may be determined whether the prediction motionvector of the prediction target block is a zero vector and may bereceived through syntax element information. In case information statingthat the prediction motion vector is the zero vector is transmittedthrough the syntax element information, the candidate prediction motionvector list information and index information for determining whatcandidate prediction motion vector is to be used for the predictionmotion vector of the prediction target block are not additionallyencoded and decoded, thereby reducing complexity of encoding anddecoding processes. At this time, the zero vector means a vector (0, 0)whose x and y components consist of all 0's.

It is determined whether the prediction motion vector is the zero vector(step S1000).

To produce predetermined syntax element information, it is determinedwhether the prediction motion vector used for the prediction targetblock is the zero vector.

In case the prediction motion vector is the zero vector, zero vectordetermination flag (zero_mvp_flag), a syntax element, is set as 1 (stepS1010), and unless the prediction motion vector is the zero vector, thezero vector determination flag, which is a syntax element, is set as 0(step S1020).

The zero vector determination flag (zero_mvp_flag) as a syntax elementis an example of a flag which indicates that the prediction motionvector used for the current prediction block is the zero vector. Theinformation stating that the prediction motion vector used for theprediction target block is the zero vector may be represented by othertypes of syntax element information, not the flag information.

In case the prediction motion vector is not the zero vector, the indexinformation of the prediction motion vector is encoded (step S1030).

In case the prediction motion vector is not the zero vector, the indexinformation may be encoded which is regarding which vector has been usedas the prediction motion vector among the candidate prediction motionvectors based on the candidate prediction motion vector list producedusing the method of producing the candidate prediction motion vectorlike the methods described above in connection with FIGS. 3 to 8.

FIG. 11 is a flowchart illustrating a method of producing a predictionmotion vector according to another embodiment of the present invention.

FIG. 11 discloses a method of decoding based on the method of encodingthe prediction motion vector described above in connection with FIG. 10.

Referring to FIG. 11, the zero vector determination flag information isdecoded to determine whether the flag value is 1 (step S1100).

As described above, the information stating that the prediction motionvector used for the prediction target block is the zero vector may berepresented by syntax element information combined with informationother than the flag information or other types of syntax elementinformation. Further, it may be arbitrarily done to determine whetherthe flag value is 1, and depending on the definition of the flag, it maybe also determined whether the flag value is 0.

In case the zero vector determination flag information is 1, theprediction motion vector of the prediction target block is determined asthe zero vector (step S1110).

In case the zero vector determination flag information is 0, the indexinformation is decoded to produce the prediction motion vector of theprediction target block (step S1120).

The zero vector determination flag value being 0 and 1 are arbitrarilyset to indicate whether the prediction motion vector of the predictiontarget block is the zero vector.

In case the zero vector determination flag information is 0, the indexinformation of the prediction target block may be decoded to produce theprediction motion vector of the prediction target block.

The prediction motion vector of the current prediction block isdetermined based on the decoded index information.

Table 1 shows a syntax structure including the zero vector determinationflag.

TABLE 1 prediction_unit(x0, y0, log2PUWidth, log2PUHeight,PartIdx){Descriptor             .             .             . if(inter_pred_flag[x0][y0]==Pred_LC){  if(num_ref_idx_lc_active_minus1>0){    if(!entropy_coding_mode_flag){   if(combined_inter_pred_ref_idx==MaxPredRef)    ref_idx_lc_minus4[x0][y0] ue(v)    }else     ref_idx_lc[x0][y0]ae(v)    }    mvd_lc[x0][y0][0] se(v)|ae(v)    mvd_lc[x0][y0][0]se(v)|ae(v)    if(!zero_mv_flag) u(1)    mvp_idx_lc[x0][y0] ue(v)|ae(v)   }             .             .             .

Referring to Table 1, depending on whether the zero vector determinationflag is 1, a process of decoding the index information of the candidateprediction motion vector is performed so that the process of producingthe candidate prediction motion vector and the candidate predictionmotion vector list may be selectively prevented from being unnecessarilyperformed during the decoding process.

FIG. 12 is a flowchart illustrating a method of producing a predictionmotion vector according to an embodiment of the present invention.

Referring to FIG. 12, the candidate prediction motion vector list isproduced (step S1200).

For example, to produce the candidate prediction motion vector list,like the method described above, the candidate prediction motion vectoris produced from the first spatial candidate prediction group, thesecond spatial candidate prediction group, and temporal candidateprediction block. Assuming that one candidate prediction motion vectoris produced for each thereof, the produced candidate prediction motionvectors are included in the candidate prediction motion vector list andmay be used to produce the prediction motion vector of the predictiontarget block. In case the candidate prediction motion vector may includeonly a predetermined number of candidate prediction motion vectors, ifthe candidate prediction motion vector list does not include thepredetermined number of the candidate prediction motion vectors,additional candidate prediction motion vectors (for example, zerovector, scaling vector, etc.) may be included in the candidateprediction motion vector list. The number of the candidate predictionmotion vectors produced from the first spatial candidate predictiongroup, the second spatial candidate prediction group, and the temporalcandidate prediction block is larger than the number of candidateprediction motion vectors that may be included in the candidateprediction motion vector list, some of the produced candidate predictionmotion vectors may be removed and then used.

The prediction motion vector of the prediction block is induced from thecandidate prediction motion vector list (step S1210).

In the method of producing the candidate prediction motion vectoraccording to an embodiment of the present invention, without using theindex information regarding the candidate prediction motion vector, theprediction motion vector may be determined from the candidate predictionmotion vector list itself. Since the encoder does not need to transmitthe index information regarding the candidate prediction motion vectorto the decoder, bits necessary to encode the index information may besaved, thereby enhancing encoding efficiency.

For example, to determine the prediction motion vector in the candidateprediction motion vector list itself, different methods may be useddepending on the size of the candidate prediction motion vector list.The size of the candidate prediction motion vector list means themaximum number of candidate prediction motion vectors that may beincluded in the candidate prediction motion vector list.

In case the size of the candidate prediction motion vector list is 0,the zero vector may be used as the prediction motion vector of theprediction block while the index information to determine the predictionmotion vector may not be additionally decoded.

In case the size of the candidate prediction motion vector list is 1,the number of candidate prediction motion vectors present in thecandidate prediction motion vector list is 1, and thus, the candidateprediction motion vectors present in the list may be used as theprediction motion vector of the prediction block. Like the situationwhere the size of the candidate prediction motion vector list is 0, theindex information to determine the prediction motion vector may not beadditionally decoded.

In case the size of the candidate prediction motion vector list is 2,among the candidate prediction motion vectors included in the candidateprediction motion vector list, the candidate prediction motion vectorthat has higher frequency of occurrence in the encoding/decoding targetslice may be induced as the prediction motion vector to decode theprediction target block. In case a plurality of candidate predictionmotion vectors are induced, the candidate prediction motion vectors maybe arranged in order of frequency of occurrence, and then, the candidateprediction motion vector having a higher frequency of occurrence may beinduced as the prediction motion vector of the prediction block. At thistime, to reduce complexity in calculating the frequency of occurrence ofthe candidate prediction motion vector, such calculation may beperformed only on N candidate prediction motion vectors (N is a naturalnumber).

In case the size of the candidate prediction motion vector list is 2, asanother embodiment of producing the prediction motion vector, thefollowing Equations 1 and 2 may be used to make comparison on the sum ofx-direction and y-direction absolute values of each candidate predictionmotion vector so that the candidate prediction motion vector having asmaller sum of the x-direction and y-direction absolute values may beused as the prediction motion vector of the prediction block.

|mvp1·x|+|mvp1·y|  <Equation 1>

|mvp2·x|+|mvp2·y|  <Equation 2>

In case the size of the candidate prediction motion vector list is 2, asstill another embodiment of producing the prediction motion vector, thefollowing Equation 3 may be used.

mvp·x=average(mvp1·x,mvp2·x)

mvp·y=average(mvp1·y,mvp2·y)  <Equation 3>

Referring to Equation 3, to extract each component of the predictionmotion vector, the x-direction component of the prediction motion vectormay be set as the average value of the x-direction components of twocandidate prediction motion vectors, and the y-direction component ofthe prediction motion vector may be set as the average value of they-direction components of the two candidate prediction motion vectors.

In case the size of the candidate prediction motion vector list is 2, asyet still another embodiment of producing the prediction motion vector,the following Equation 4 may be used.

mvp·x=median(mvp1·x,mvp2·x,0)

mvp·y=median(mvp1·y,mvp2·y,0)  <Equation 4>

Referring to Equation 4, to extract each component of the predictionmotion vector, the x-direction component of the prediction motion vectormay be set as the median value of the zero vector and the x-directioncomponents of two candidate prediction motion vectors, and they-direction component of the prediction motion vector may be set as themedian value of the zero vector and the y-direction components of thetwo candidate prediction motion vectors.

In case the size of the candidate prediction motion vector list is 2, asyet still another embodiment of producing the prediction motion vector,the following Equation 5 may be used.

mvp·x=average(mvp1·x,mvp2·x,0)

mvp·y=average(mvp1·y,mvp2·y,0)  <Equation 5>

Referring to Equation 5, to extract each component of the motion vector,the x-direction component of the prediction motion vector may be set asthe average value of the zero vector and the x-direction components oftwo candidate prediction motion vectors, and the y-direction componentof the prediction motion vector may be set as the average of the zerovector and the y-direction components of the two candidate predictionmotion vectors.

In case the size of the candidate prediction motion vector list is 2, asyet still another embodiment of producing the prediction motion vector,when the N motion vectors used for calculating the frequency ofoccurrence that is used in the above-described statistical method arenot the same as the two candidate prediction motion vectors in thecandidate prediction motion vector list which are subject to calculationof the frequency, based on the index information, the index informationthat occurs more frequently may be used as the prediction motion vectorof the prediction block. For example, in case the candidate predictionmotion vector present at index 0 in the previous candidate predictionmotion vector list is used as the prediction motion vector, thecandidate prediction motion vector present at index 0 may be used as theprediction motion vector.

In case the size of the candidate prediction motion vector list is 3,since the number of the candidate prediction motion vectors present inthe candidate prediction motion vector list is 3, one of them may bedetermined as the prediction motion vector.

The following Equation 6 represents a method of determining theprediction motion vector.

mvp·x=median(mvp1·x,mvp2·x,mvp3·x)

mvp·y=median(mvp1·y,mvp2·y,mvp3·y)  <Equation 6>

Referring to Equation 6, to produce the prediction motion vector, amongthe three candidate prediction motion vectors, the candidate predictionmotion vector whose x-direction component corresponds to the medianvalue of the x-direction components of the three candidate predictionmotion vectors and the candidate prediction motion vector whosey-direction component corresponds to the median value of the y-directioncomponents of the three candidate prediction motion vectors may be abasis to produce the prediction motion vector of the prediction targetblock.

In case the size of the candidate prediction motion vector list is 3, asyet still another embodiment of producing the prediction motion vector,the following Equation 7 may be used.

mvp·x=average(mvp1·x,mvp2·x,mvp3·x)

mvp·y=average(mvp1·y,mvp2·y,mvp3·y)  <Equation 7>

Referring to Equation 7, to produce the prediction motion vector, amongthe three candidate prediction motion vectors, the candidate predictionmotion vector which corresponds to the average value of the x-directioncomponents of the three candidate prediction motion vectors and thecandidate prediction motion vector which corresponds to the averagevalue of the y-direction components of the three candidate predictionmotion vectors may be a basis to produce the prediction motion vector ofthe prediction target block.

Even when three candidate prediction motion vectors are present in thecandidate prediction motion vector list, no index information may beused when producing one prediction motion vector in the candidateprediction motion vector list.

FIG. 13 is a flowchart illustrating a method of producing a predictionmotion vector according to another embodiment of the present invention.

It may be assumed that the maximum number of candidate prediction motionvectors that may be included in the candidate prediction motion vectorlist is N, and the spatial candidate prediction motion vector is firstinduced from the spatial candidate prediction group and the temporalcandidate motion vector is induced from the temporal candidateprediction block. According to an embodiment of the present invention,in case the number (N) of the candidate prediction motion vectorsinduced from the spatial candidate prediction group is the same as thenumber of candidate prediction motion vectors that may be included inthe candidate prediction motion vector list, a process of inducing thecandidate prediction motion vector from the temporal candidateprediction block and a process of inducing the additional candidateprediction motion vector may be skipped.

That is, according to an embodiment of the present invention, when themotion vector necessary for the candidate prediction motion vector listhas been already produced, no process of inducing unnecessary candidateprediction motion vectors is performed, thereby reducing complexity ofthe encoding and decoding processes.

Referring to FIG. 13, it is determined whether the number of candidateprediction motion vectors that may be included in the candidateprediction motion vector list is larger than the number of producedspatial candidate prediction motion vectors (step S1300).

The number of candidate prediction motion vectors that may be includedin the candidate prediction motion vector list may be restricted. Forexample, assuming that N prediction motion vectors may be included inthe candidate prediction motion vector list, if the number of thespatial candidate prediction motion vectors produced in the spatialcandidate prediction group is smaller than N, the temporal predictionmotion vector may be produced from the temporal candidate predictionblock or additional prediction motion vectors may be produced. Unlikethis, assuming that N prediction motion vectors may be included in thecandidate prediction motion vector list, if the number of the spatialcandidate prediction motion vectors produced in the spatial candidateprediction group is equal to or larger than N, the candidate predictionmotion vector list may be produced without producing additionalprediction motion vectors or without producing the temporal predictionmotion vector from the temporal candidate prediction block (step S1320).

In case the number of the spatial candidate prediction motion vectorsproduced in the spatial candidate prediction group is smaller than N,the temporal candidate prediction motion vector or additional motionvector is produced (step S1310). At this time, the additional predictionmotion vector may be the zero vector.

In case the number of the candidate prediction motion vectors that maybe included in the candidate prediction motion vector list is largerthan the number of the produced spatial candidate prediction motionvectors through the step of determining whether the number of thecandidate prediction motion vectors that may be included in thecandidate prediction motion vector list is larger than the number of theproduced spatial candidate prediction motion vectors, the candidateprediction motion vector produced through step S1310 of producing thetemporal prediction motion vector or additional prediction motion vectormay be included in the candidate prediction motion vector list.

The produced spatial candidate prediction motion vector, the temporalcandidate prediction motion vector or additional prediction motionvector are used to produce the candidate prediction motion vector list(step S1320).

FIG. 14 is a flowchart illustrating a method of producing a candidateprediction motion vector according to an embodiment of the presentinvention.

Referring to FIG. 14, the spatial candidate prediction motion vector isproduced (step S1400).

From the encoded/decoded block (or adjacent prediction block) positionedadjacent to the prediction target block, information regarding aplurality of spatial candidate prediction motion vectors may be induced.The information regarding the spatial candidate prediction motionvectors may include at least one of spatial candidate prediction motionvector availability information (availableFlagLXN) and spatial candidateprediction motion vector (mvLXN). That is, the unit of informationincluding all of the spatial candidate prediction motion vectoravailability information and the spatial candidate prediction motionvector may be referred to as the spatial candidate prediction motionvector related information, or one of the spatial candidate predictionmotion vector availability information and the spatial candidateprediction motion vector may be referred to as the spatial candidateprediction motion vector related information.

For example, as shown in FIG. 3, from B1 which is a block adjacent tothe upper end of the prediction target block X, A1 which is a blockadjacent to the left side of the prediction target block, B0 which is ablock positioned at the upper and right corner of the prediction targetblock, B2 which is a block positioned at the upper and left corner ofthe prediction target block, and A0 which is a block positioned at thelower and left corner of the prediction target block, the spatialcandidate prediction motion vector may be induced and may be determinedas the spatial candidate prediction motion vector for the predictiontarget block. From the blocks A0, A1, B0, B1, and B2 (hereinafter,referred to as “spatial candidate prediction blocks”), up to two spatialcandidate prediction motion vectors may be produced with respect to theencoding/decoding target block. Hereinafter, the blocks A0, A1, B0, B1,and B2 are referred to as the spatial candidate prediction blocks, whilethe blocks A0 and A1 may be classified into a first spatial candidateprediction block group, and the blocks B0, B1, and B2 may be classifiedinto a second spatial candidate prediction block group.

These spatial candidate prediction block groups are merely an example.The spatial candidate prediction block group may be created to consistof the blocks located at other positions, which is also included in thescope of the present invention. Hereinafter, according to an embodimentof the present invention, for ease of description, the spatial candidateprediction block groups are assumed to consist of the blocks located atthe above-described positions.

In case the spatial candidate prediction motion vector is induced fromthe spatial candidate prediction block, availableFlagLXY is set as 1,and otherwise, as 0. In ‘availableFlagLXY’, ‘LX’ represents which one ofthe reference picture lists L0 and L1 the prediction target block refersto, and LX may be replaced by L0 or L1. Further, in ‘availableFlagLXY’,‘Y’ refers to the position in which the spatial candidate predictionmotion vector is induced. As shown in FIG. 2, if the spatial candidateprediction motion vector is induced from the block positioned at A0 orA1, Y may be A, and if the spatial candidate prediction motion vector isinduced from the blocks positioned at B0, B1, or B2, Y may be B. At thistime, the reference picture list means a list including referencepictures used for inter prediction or motion compensation. The type ofthe reference picture list may include LC (List Combined), L0 (List 0),or L1 (List 1). The reference picture means an picture to which aspecific block refer for inter prediction or motion compensation.

For example, one spatial candidate prediction motion vector may beinduced from the block positioned at A0 or A1, and one spatial candidateprediction motion vector may be induced from the block positioned at B0,B1, or B2. At this time, if the prediction target block refers to thereference picture list L0, and one spatial candidate prediction motionvector is induced from the block positioned at A0 and one spatialcandidate prediction motion vector is induced from the block positionedat B1, availableFlagL0A is set as 1, and availableFlagL0B is set as 1.That is, in case the prediction target block refers to the referencepicture list LX, availableFlagLXY refers to whether there is a spatialcandidate prediction motion vector induced from a block located at apredetermined position.

Referring back to FIG. 4, the spatial candidate prediction motionvectors that may be induced may be classified into four motion vectorsas follows:

(1) First motion vector: in case a block is available at a predeterminedposition, the corresponding block is not subjected to intra encoding,and the reference picture list and the reference picture of thecorresponding block are the same as the reference picture list and thereference picture of the encoding/decoding target block, a candidateprediction motion vector induced from the corresponding block.

(2) second motion vector: in case a block is available at apredetermined position, the corresponding block is not subjected tointra encoding, and the reference picture list of the correspondingblock is different from the reference picture list of theencoding/decoding target block while the corresponding block and theencoding/decoding target block refer to the same reference picture, acandidate prediction motion vector induced from the corresponding block.

(3) third motion vector: in case a block is available at a predeterminedposition, the corresponding block is not subjected to intra encoding,and the reference picture list of the corresponding block is the same asthe reference picture list of the encoding/decoding target block whilethe reference picture of the corresponding block is different from thereference picture of the encoding/decoding target block, a candidateprediction motion vector produced by performing scaling on the motionvector of the corresponding block.

(4) fourth motion vector: in case a block is available at apredetermined position, the corresponding block is not subjected tointra encoding, and the reference picture list and reference picture ofthe corresponding block are different from the reference picture listand reference picture of the encoding/decoding target block, a candidateprediction motion vector produced by performing scaling on the motionvector of the corresponding block.

It may be determined in the following order whether the above-classifiedfour spatial candidate prediction motion vectors are available in thespatial candidate prediction block.

(1) First Spatial Candidate Prediction Block Group

1) it is determined whether there is the first motion vector or thesecond motion vector in block A0.

2) it is determined whether there is the first motion vector or thesecond motion vector in block A1.

3) it is determined whether there is the third motion vector or thefourth motion vector in block A0.

4) it is determined whether there is the third motion vector or thefourth motion vector in block A1.

The above steps 1) to 4) may be sequentially performed to determinewhether there is a spatial candidate prediction motion vector satisfyingthe condition in the corresponding block, and in case there is a spatialcandidate prediction motion vector satisfying the condition, thecorresponding motion vector is induced while the step is not performed.For example, in case there is a spatial candidate prediction motionvector satisfying the step 1), steps 2) to 4) may be skipped.

In case the spatial candidate prediction motion vector satisfying thecondition through the steps 3) and 4) is the third motion vector or thefourth motion vector, the spatial candidate prediction motion vector maybe produced through scaling. In such case, flag information indicatingwhether to perform scaling may be used to indicate that scaling has beenused. Or, in case block A0 is available and block A0 does not use theintra prediction mode or in case block A1 is available and block A1 doesnot use the intra prediction mode, the flag indicating whether toperform scaling is set as 1, and in case no spatial candidate predictionmotion vector may be produced from the first spatial candidateprediction block group as if blocks A0 and A1 are not available or intraprediction is used, the flag indicating whether to perform scaling isset as 0 so that two spatial candidate prediction motion vectors may beproduced from the second spatial candidate prediction block group.Hereinafter, according to an embodiment of the present invention, forease of description, it is assumed that the first spatial candidateprediction motion vector is produced from the first spatial candidateprediction block group, and the second spatial candidate predictionmotion vector is produced from the second spatial candidate predictionblock group.

What follows is an order in which the spatial candidate predictionmotion vector is produced from the second spatial candidate predictionblock group:

(2) Second Spatial Candidate Prediction Block Group

1) it is determined whether there is the first motion vector or thesecond motion vector in block B0.

2) it is determined whether there is the first motion vector or thesecond motion vector in block B1.

3) it is determined whether there is the first motion vector or thesecond motion vector in block B2.

4) it is determined whether there is the third motion vector or thefourth motion vector in block B0.

5) it is determined whether there is the third motion vector or thefourth motion vector in block B1.

6) it is determined whether there is the third motion vector or thefourth motion vector in block B2.

Like when producing the first spatial candidate prediction motionvector, the steps 1) to 6) are sequentially performed to determinewhether there is a spatial candidate prediction motion vector satisfyingthe condition in the corresponding block, and in case there is a spatialcandidate prediction motion vector satisfying the condition, thecorresponding motion vector is induced and the following steps may beskipped.

Further, up to N spatial candidate prediction motion vectors may beinduced. At this time, N may be a positive integer, for example, 2.

It is determined whether the induced two spatial candidate predictionmotion vectors are different from each other (step S1410).

According to an embodiment of the present invention, based on thespatial candidate prediction motion vector related information, thetemporal candidate prediction motion vector related information (forexample, at least one of temporal candidate prediction motion vectoravailability information and temporal candidate prediction motionvector) may be determined. That is, based on the spatial candidateprediction motion vector related information induced in step S1400, itmay be determined whether to induce the temporal candidate predictionmotion vector.

To determine whether the induced two spatial candidate prediction motionvectors are different from each other, it is determined whether twospatial candidate prediction motion vectors may be induced, and todetermine whether, in case two spatial candidate prediction motionvectors are induced, the induced spatial candidate prediction motionvectors are different from each other, it is determined whetheravailableFlagLXA and availableFlagLXB are both 1, and whether mvLXA isthe same as mvLXB or not. availableFlagLXA is a flag indicating whetherthe first spatial candidate prediction motion vector may be producedfrom the first spatial candidate prediction group, and availableFlagLXBis a flag indicating whether the second spatial candidate predictionmotion vector may be produced from the second spatial candidateprediction group. For example, in case the first spatial candidateprediction motion vector may be produced from the first spatialcandidate prediction group, availableFlagLXA may be set as 1. mvLXA isthe first spatial candidate prediction motion vector and may be producedwhen availableFlagLXA is available, and mvLXB is the second spatialcandidate prediction motion vector and may be produced whenavailableFlagLXB is available.

Hereinafter, according to an embodiment of the present invention,availableFlagLXA may be defined as the first spatial candidateprediction motion vector availability information, and availableFlagLXBmay be defined as the second spatial candidate prediction motion vectoravailability information. Further, mvLXA may be defined as the firstspatial candidate prediction motion vector, and mvLXB may be defined asthe second spatial candidate prediction motion vector.

If it is assumed that availableFlagLXA and availableFlagLXB are both 1,mvLXA and mvLXB are not the same as each other, and the maximum numberof candidate prediction motion vectors that may be included in thecandidate prediction motion vector list is 2, the candidate predictionmotion vector list may consist of the spatial candidate predictionmotion vectors, and thus no additional candidate prediction motionvector needs to be induced. Accordingly, it is not required to inducethe temporal candidate prediction motion vector which is the candidateprediction motion vector induced from the collocated block (temporalcandidate prediction block). Thus, availableFlagLXCol, which is flaginformation indicating whether the temporal candidate prediction motionvector is available, is set as 0, and the candidate prediction motionvector list is produced only from the spatial candidate predictionmotion vectors induced as in step S1430 to be described below. That is,since the temporal candidate prediction motion vector is not induced,complexity may be reduced during the process of inducing the candidateprediction motion vector.

That is, the temporal candidate prediction motion vector relatedinformation may be determined based on the spatial candidate predictionmotion vector related information.

In case availableFlagLXA and availableFlagLXB are both 1, it may bepossible to selectively determine whether mvLXA is the same as mvLXB.For example, two determination conditions may be used to perform 1) stepof determining whether availableFlagLXA and availableFlagLXB are both 1and 2) step of, in case availableFlagLXA and availableFlagLXB are both1, determining whether mvLXA is the same as mvLXB.

In case two spatial candidate prediction motion vectors are not inducedor induced two candidate prediction motion vectors are the same as eachother, the temporal candidate prediction motion vector is produced fromthe collocated block (step S1420).

That is, in step S1420, the temporal candidate prediction motion vectorrelated information may be determined based on the spatial candidateprediction motion vector related information.

In case neither availableFlagLXA nor availableFlagLXB is 1 or in casemvLXA is the same as mvLXB, the temporal candidate prediction motionvector is produced from the collocated block.

If it is assumed that two candidate prediction motion vectors need to beincluded in the candidate prediction motion vector list, in case neitheravailableFlagLXA nor availableFlagLXB is 1 or mvLXA is the same asmvLXB, two candidate prediction motion vectors are not included in thecandidate prediction motion vector list, and thus, the temporalcandidate prediction motion vector needs to be produced from thecollocated block.

The following Tables 2 and 3 represent whether to perform the process ofinducing the temporal candidate prediction motion vector depending onthe result of inducing the spatial candidate prediction motion vector.

TABLE 2 Cases 1 2 Whether to induce Induce only one Induce two spatialmotion vector availableFlagLXY In case In case value after step ofavailableFlagLXA is 1 and availableFlagLXA is 1 and inducing spatialcandidate availableFlagLXB is 0 or In availableFlagLXB is 1 predictionmotion vector is case availableFlagLXA is performed 0 andavailableFlagLXB is 1 Whether spatial — Yes motion vectors are the sameWhether to perform Yes Yes process of inducing temporal motion vectoravailableFlagLXCol If temporal motion If temporal motion value afterstep of vector is induced, vector is induced, inducing temporalavailableFlagLXCol is set availableFlagLXCol is set candidate predictionas 1, otherwise as 1, otherwise motion vector is performedavailableFlagLXCol is set availableFlagLXCol is set as 0 as 0

TABLE 3 Cases 3 4 Whether to induce Induce two No spatial motion vectoravailableFlagLXY In case In case value after step of availableFlagLXA is1 and availableFlagLXA is 0 and inducing spatial candidateavailableFlagLXB is 1 availableFlagLXB is 0 prediction motion vector isperformed Whether spatial No — motion vectors are the same Whether toperform No Yes process of inducing temporal motion vectoravailableFlagLXCol availableFlagLXCol If temporal motion value afterstep of is set as 0 vector is induced, inducing temporalavailableFlagLXCol is set candidate prediction as 1, otherwise motionvector is performed availableFlagLXCol is set as 0

Referring to Tables 2 and 3, in case the spatial candidate predictionmotion vector is produced, depending on availableFlagLXY indicatingwhether the spatial candidate prediction motion vector is available anddepending on whether the induced spatial candidate prediction motionvectors are the same, there may be four steps of inducing the temporalcandidate prediction motion vector. Hereinafter, with respect to thefour cases depending on availableFlagLXY of the spatial candidateprediction motion vector, it is described to induce the temporalcandidate prediction motion vector.

(1) Case that one spatial candidate prediction motion vector is induced.This is when availableFlagLXA is 1 and availableFlagLXB is 0 or whenavailableFlagLXA is 0 and availableFlagLXB is 1. In the first case, onespatial candidate prediction motion vector only is induced, and thus, itcannot be possible to determine whether the spatial candidate predictionmotion vectors are the same. In case the number of candidate predictionmotion vectors that may be included in the candidate prediction motionvector list is 2, the step of inducing the temporal candidate predictionmotion vector is performed to produce the additional candidateprediction motion vector. If the temporal candidate prediction motionvector is induced, availableFlagLXCol is set as 1, and otherwise,availableFlagLXCol is set as 0.

(2) Case that two candidate prediction motion vectors are induced. Thisis when availableFlagLXA and availableFlagLXB are 1. If the inducedspatial candidate prediction motion vectors have the same value, one ofthe same spatial candidate prediction motion vectors is removed. Sinceone candidate prediction motion vector remains, in case the number ofcandidate prediction motion vectors that may be included in thecandidate prediction motion vector list is 2, the step of inducing thetemporal candidate prediction motion vector is performed to produce theadditional candidate prediction motion vector. In case the temporalcandidate prediction motion vector is induced, availableFlagLXCol is setas 1, and unless the temporal candidate prediction motion vector isinduced, availableFlagLXCol may be set as 0.

(3) Case that two spatial candidate prediction motion vectors areinduced. This is when availableFlagLXA and availableFlagLXB are 1. Ifthe induced spatial candidate prediction motion vectors do not have thesame value, in case the number of candidate prediction motion vectorsthat may be included in the candidate prediction motion vector list is2, the step of inducing the temporal candidate prediction motion vectorneed not be performed to produce the additional candidate predictionmotion vector, and availableFlagLXCol indicating the availability of thetemporal candidate prediction motion vector is set as 0. At this time,if availableFlagLXCol, which is availability information of the temporalcandidate prediction motion vector, is a predetermined value, ‘0’, thenthis means that no temporal candidate prediction motion vector isinduced or that the temporal candidate prediction motion vector is notavailable.

(4) Case that two spatial candidate prediction motion vectors are notinduced. This is when availableFlagLXA and availableFlagLXB are 0. Insuch case, the process of inducing the temporal candidate predictionmotion vector is performed to produce the temporal candidate predictionmotion vector.

That is, in case the maximum number of candidate prediction motionvectors that may be included in the candidate prediction motion vectorlist is 2, two types of spatial candidate prediction motion vectoravailability information (availableFlagLXA, availableFlagLXB) are both1, and the produced two spatial candidate prediction motion vectors arenot the same as each other, the temporal candidate prediction motionvector is not produced.

In the above-described embodiment of the present invention, as thespatial candidate prediction motion vector related information, thespatial candidate prediction motion vector availability information andthe spatial candidate prediction motion vector are all used to inducethe temporal candidate prediction motion vector related information.However, based on at least one of the spatial candidate predictionmotion vector availability information and spatial candidate predictionmotion vector, it may be used to induce the temporal candidateprediction motion vector related information as the spatial candidateprediction motion vector related information.

For example, in case the spatial candidate prediction motion vectors areinduced, and the two induced spatial candidate prediction motion vectorshave different values, the temporal candidate prediction motion vectorrelated information may be induced without determining what value thespatial candidate prediction motion vector availability information has.

Hereinafter, a method of producing a temporal candidate predictionmotion vector is described.

FIG. 15 is a conceptual view illustrating a method of producing atemporal candidate prediction motion vector according to an embodimentof the present invention.

Referring to FIG. 15, a temporal candidate prediction motion vector maybe produced from a collocated block 1520 present in a collocated pictureof a prediction target block 1500.

In case a point position at a left and upper end of the predictiontarget block is (xP, yP), the width of the prediction target block isnPSW, and the height of the prediction target block is nPSH, a firstcollocated block 1540 may be a block including a point (xP+nPSW,yP+nPSH) positioned in the collocated picture, and a second collocatedblock 1560 may be a block including a point (xP+(nPSW>>1), yP+(nPSH>>1))positioned in the collocated picture. In case the temporal candidateprediction motion vector is not induced from the first collocated block(for example, in case the first collocated block is subjected to intraprediction encoding), the temporal candidate prediction motion vectormay be induced from the second collocated block. The number of theproduced temporal candidate prediction motion vectors may be restricted.For example, in case maximally one temporal candidate prediction motionvector only is restricted to be produced, if the temporal candidateprediction motion vector is produced from the first collocated block, notemporal candidate prediction motion vector may be produced from thesecond collocated block. In case of the temporal candidate predictionmotion vector, the temporal candidate prediction motion vector value maybe scaled based on a relationship of a distance between the pictureincluding the prediction target block and the reference picture of theprediction target block and a distance between the picture including thecollocated block and the reference picture of the collocated block.

Depending on whether the temporal candidate prediction motion vector hasbeen induced, availableFlagLXCol is determined. In ‘availableFlagLXCol’,‘LX’ refers to which one of the reference picture lists L0 and L1 theencoding/decoding target block has referred. LX may be replaced by L0 orL1. In case the temporal candidate prediction motion vector is induced,availableFlagLXCol is set as 1, and in case the temporal candidateprediction motion vector is not induced, availableFlagLXCol is set as 0.

For example, if the encoding/decoding target block refers to thereference picture list L0 and the temporal candidate prediction motionvector is induced from the block positioned at H of FIG. 15,availableFlagL0Col is set as 1, and if no temporal candidate predictionmotion vector is induced, availableFlagL0Col is set as 0.

The induced candidate prediction motion vector is added to the candidateprediction motion vector list (step S1430).

The induced spatial candidate prediction motion vector and temporalcandidate prediction motion vector are added to the candidate predictionmotion vector list in order of being induced. For example, the candidateprediction motion vector list may add the candidate prediction motionvector depending on the values of availableFlagLXA, availableFlagLXB,and availableFlagLXCol. For example, in case availableFlagLXA is 1,availableFlagLXB is 0, and availableFlagLXCol is 1, one spatialcandidate prediction motion vector mvLXA and one temporal candidateprediction motion vector mvLXCol are added to the candidate predictionmotion vector list. As another example, in case availableFlagLXA is 1,availableFlagLXB is 1, and availableFlagLXCol is 0, two spatialcandidate prediction motion vectors mvLXA and mvLXB are added to thecandidate prediction motion vector list.

As still another example, in case the spatial candidate predictionmotion vector or temporal candidate prediction motion vector is inducedwithout determining the spatial candidate prediction motion vectoravailability information or temporal candidate prediction motion vectoravailability information, the vector may be immediately added to thecandidate prediction motion vector list.

The size of the candidate prediction motion vector list may be limitedto a predetermined size. For example, the predetermined size may be 3.The first candidate prediction motion vector added to the candidateprediction motion vector list may have an index value of 0, and the lastcandidate prediction motion vector added to the candidate predictionmotion vector list may have an index value of 2.

That is, it is determined whether the number of candidate predictionmotion vectors included in the candidate prediction motion vector listis smaller than the maximum number of the candidate prediction motionvectors that may be included in the candidate prediction motion vectorlist. Based on a result of the determination, the candidate predictionmotion vector may be added or removed from the candidate predictionmotion vector list.

For example, in case the number of the candidate prediction motionvectors included in the candidate prediction motion vector list issmaller than the maximum number of the candidate prediction motionvectors, a zero vector may be added to the candidate prediction motionvector list. Further, in case the number of the candidate predictionmotion vectors included in the candidate prediction motion vector listis equal to or larger than the maximum number of the candidateprediction motion vectors, some of the candidate prediction motionvectors may be removed from the candidate prediction motion vector listso that as many candidate prediction motion vectors as the maximumnumber may be included in the candidate prediction motion vector list.

FIG. 16 is a conceptual view illustrating a method of producing acandidate prediction motion vector list according to an embodiment ofthe present invention.

Referring to FIG. 16, if a non-scaled spatial candidate predictionmotion vector (1, 0) is induced from block A1, a scaled spatialcandidate prediction motion vector (−2, 0) is induced from block B1, anda scaled temporal candidate prediction motion vector (4, 1) is inducedfrom block H, the induced candidate prediction motion vectors are addedto the candidate prediction motion vector list in order of being inducedas in the left table. At this time, the index value of the candidateprediction motion vector induced from the block positioned at A1 may be0, the index value of the candidate prediction motion vector inducedfrom the block positioned at B1 may be 1, and the index value of thecandidate prediction motion vector induced from the block positioned atH may be 2.

If as in the third case of Table 3 the size of the candidate predictionmotion vector list is 2, the number of the induced spatial candidateprediction motion vectors is 2, and the two spatial candidate predictionmotion vectors are different from each other, since the size of thecandidate prediction motion vector list is 2, without the need ofseparately inducing the temporal candidate prediction motion vector,indexes are sequentially assigned to the induced spatial candidateprediction motion vectors, thereby configuring the candidate predictionmotion vector list.

The same candidate prediction motion vectors are removed to therebyreconfigure the candidate prediction motion vector list (step S1440).

It is determined whether there are the same candidate prediction motionvectors among the spatial candidate prediction motion vectors and thetemporal candidate prediction motion vectors included in the candidateprediction motion vector list, and if there is any, one of the samecandidate prediction motion vectors is removed, thereby reconfiguringthe candidate prediction motion vector list.

For example, in case the first spatial candidate prediction motionvector and the second spatial candidate prediction motion vector, whichconstitute the candidate prediction motion vector list, are the same aseach other, the second spatial candidate prediction motion vector may beremoved from the candidate prediction motion vector list.

FIG. 17 is a conceptual view illustrating removing the same candidateprediction motion vector from the candidate prediction motion vectorlist according to an embodiment of the present invention.

Referring to FIG. 17, in case the candidate prediction motion vectorswhose index is 0 and 1, which are included in the candidate predictionmotion vector list, are the same as each other, the candidate predictionmotion vector having the smaller index value is left while the othercandidate prediction motion vector having the same value may be removed.The index value of the candidate prediction motion vector, which islarger than the index value of the removed candidate prediction motionvector, is changed by the number of the removed candidate predictionmotion vectors.

A candidate prediction motion vector is added and removed, therebyreadjusting the size of the candidate prediction motion vector list(step S1450).

By adding or removing a candidate prediction motion vector to/from thecandidate prediction motion vector list, the size of the candidateprediction motion vector list may be adjusted. In case P is the numberof candidate prediction motion vectors included in the candidateprediction motion vector list, and Q is the size of the final candidateprediction motion vector list, if P is smaller than Q, a candidateprediction motion vector may be added to the candidate prediction motionvector list while if P is larger than Q, a candidate prediction motionvector may be removed from the candidate prediction motion vector listso that P is equal to Q.

FIG. 18 is a conceptual view illustrating a method of adjusting the sizeof the candidate prediction motion vector list by adding or removing thecandidate prediction motion vector according to an embodiment of thepresent invention.

For example, assume that the size of the candidate prediction motionvector list is 2. Referring to the upper part of FIG. 18, since onecandidate prediction motion vector is included in the candidateprediction motion vector list, a zero vector (0, 0) is added to thecandidate prediction motion vector list, thereby configuring thecandidate prediction motion vector list.

Referring to the lower part of FIG. 18, since three candidate predictionmotion vectors are included in the candidate prediction motion vectorlist, one candidate prediction motion vector having the largest indexvalue in the candidate prediction motion vector list may be removed,thereby configuring the candidate prediction motion vector list.

The final prediction motion vectors are determined from the candidateprediction motion vector list (step S1460).

Based on the candidate prediction motion vector list produced throughstep S1400 to step S1460 and the index information of the finalprediction motion vector transmitted from the encoder, the finalprediction motion vector to be used for motion compensation isdetermined.

FIG. 19 is a conceptual view illustrating determining the finalprediction motion vector in the candidate prediction motion vector listaccording to an embodiment of the present invention.

Referring to FIG. 19, in case the encoder transmits information statingthat the candidate prediction motion vector corresponding to index 1 hasbeen used as the final prediction motion vector, the candidateprediction motion vector corresponding to index 1, for example, (−3, 6),in the produced candidate prediction motion vector list may bedetermined as the final prediction motion vector.

FIG. 20 is a flowchart illustrating a method of producing a candidateprediction motion vector list according to an embodiment of the presentinvention.

FIG. 20 summarizes the methods of producing the candidate predictionmotion vector list without inducing the temporal candidate predictionmotion vector in case the induced spatial candidate prediction motionvectors are different from each other and with inducing the temporalcandidate prediction motion vector in case the spatial candidateprediction motion vectors are the same as each other as described incase of above in connection with FIGS. 14 to 19.

1) whether both the first spatial candidate prediction motion vectoravailability information indicating whether there is a spatial candidateprediction motion vector in the first spatial candidate prediction blockgroup (A0, A1) and the second spatial candidate prediction motion vectoravailability information indicating whether there is a spatial candidateprediction motion vector in the second spatial candidate predictionblock group (B0, B1, B2) are available; and

2) whether the first spatial candidate prediction motion vector inducedfrom the first spatial candidate prediction group is different from thesecond spatial candidate prediction motion vector induced from thesecond spatial candidate prediction group are determined (step S2000).

Identical to the above-described step S1410, step S2000 may induce thespatial candidate prediction motion vectors based on the availabilityinformation and may determine whether two induced spatial candidateprediction motion vectors are different from each other.

The availability information of the first spatial candidate predictionmotion vector may be produced through the following steps.

The first motion vector to the fourth motion vector are defined asdescribed above in connection with FIG. 4.

(1) Step of determining whether there is the first motion vector in thefirst block A0 or the second block A1 included in the first spatialcandidate prediction block group,

(2) Step of determining whether there is the second motion vector in thefirst block A0 and the second block A1 of the first spatial candidateprediction block group in case there is no first motion vector in thefirst block A0 or the second block A1 included in the first spatialcandidate prediction block group,

(3) Step of determining whether there is the third motion vector in thefirst block A0 and the second block A1 of the first spatial candidateprediction block group in case the first motion vector or the secondmotion vector is not available in the first block A0 or the second blockA1 included in the first spatial candidate prediction block group,

(4) Step of determining whether there is the fourth motion vector in thefirst block A0 and the second block A1 of the first spatial candidateprediction block group in case the first motion vector, the secondmotion vector, or the third motion vector is not available in the firstblock A0 or the second block A1 included in the first spatial candidateprediction block group.

According to an embodiment of the present invention, in case there isthe first block A0 and the second block A1 included in the first spatialcandidate prediction block group are not available or in case the firstblock A0 and the second block A1 included in the first spatial candidateprediction block group are blocks that have undergone intra prediction,predetermined flag information may be used to mark such information.According to an embodiment of the present invention, in case the firstblock A0 and the second block A1 included in the first spatial candidateprediction block group are not available or in case the first block A0and the second block A1 included in the first spatial candidateprediction block group are blocks that have undergone intra prediction,and in case the first motion vector or second motion vector is availablein the third block, the fourth block or fifth block in the secondspatial candidate prediction block group, the first motion vector or thesecond motion vector induced from the second spatial candidateprediction block group may be used as the first spatial candidateprediction motion vector.

The availability information of the second spatial candidate predictionmotion vector may be produced through the following steps.

(1) Step of determining whether there is the first motion vector in thethird block B0, the fourth block B1, or the fifth block B2 included inthe second spatial candidate prediction block group,

(2) Step of determining whether there is the second motion vector in thethird block B0, the fourth block B1, or the fifth block B2 of the secondspatial candidate prediction block group in case there is no firstmotion vector in the third block B0, the fourth block B1, or the fifthblock B2 included in the second spatial candidate prediction blockgroup,

(3) Step of determining whether there is the third motion vector in thethird block B0, the fourth block B1, or the fifth block B2 of the secondspatial candidate prediction block group in case the first motion vectoror the second motion vector is not available in the third block B0, thefourth block B1, or the fifth block B2 included in the second spatialcandidate prediction block group,

(4) Step of determining whether there is the fourth motion vector in thethird block B0, the fourth block B1, or the fifth block B2 of the secondspatial candidate prediction block group in case the first motionvector, the second motion vector, or the third motion vector is notavailable in the third block B0, the fourth block B1, or the fifth blockB2 included in the second spatial candidate prediction block group.

If the conditions disclosed in step S2000 are not satisfied, thetemporal candidate prediction motion vector is induced (step S2010).

If the conditions disclosed in step S2000 are satisfied, then twodifferent spatial candidate prediction motion vectors are available.However, if the conditions disclosed in step S2000 are not satisfied,one or less spatial candidate prediction motion vector is available orthe same two spatial candidate prediction motion vectors are available.Accordingly, in case the conditions disclosed in step S2000 are notsatisfied, the temporal candidate prediction motion vector may beinduced.

In case the conditions disclosed in step S2000 are met, the temporalcandidate prediction motion vector availability information is set as 0(step S2020).

In case the conditions disclosed in step S2000 are met, withoutperforming the operation of producing the temporal candidate predictionmotion vector, the temporal candidate prediction motion vectoravailability information, which indicates whether the temporal candidateprediction motion vector is available, is set as 0.

The candidate prediction motion vector list is produced (step S2030).

The candidate prediction motion vector list may be indexed in thefollowing order and may be produced.

1) In case the first spatial candidate prediction motion vector isavailable, the first spatial candidate prediction motion vector.

2) In case the second spatial candidate prediction motion vector isavailable, the second spatial candidate prediction motion vector.

3) in case the temporal candidate prediction motion vector is available,the temporal candidate prediction motion vector.

The same spatial candidate prediction motion vector is removed (stepS2040).

In case the first spatial candidate prediction motion vector is the sameas the second spatial candidate prediction motion vector, the secondspatial candidate prediction motion vector may be removed from thecandidate prediction motion vector list.

Some spatial candidate prediction motion vectors may be added or removedto/from the candidate prediction motion vector list, thereby adjustingthe size of the candidate prediction motion vector list (step S2050).

In case the number of the candidate prediction motion vectors includedin the candidate prediction motion vector list is 2 or less, anadditional vector, such as a zero vector, may be added to the candidateprediction motion vector list, and in case the number of the candidateprediction motion vectors included in the candidate prediction motionvector list is larger than 2, the candidate prediction motion vectorsexcept for the candidate prediction motion vectors corresponding toindex 0 and index 1 may be removed from the candidate prediction motionvector list.

The final prediction motion vector is determined from the candidateprediction motion vector list (step S2060).

One of the candidate prediction motion vectors included in the candidateprediction motion vector list may be used as the final prediction motionvector that is the predicted motion vector of the prediction targetblock.

The above-described video encoding and video decoding methods may beimplemented by each of the components that constitute each of the videoencoder and the video decoder, which are described above in connectionwith FIGS. 1 and 2.

Although the embodiments of the present invention have been described,it may be understood by those skilled in the art that variousmodifications or alterations may be made to the present inventionwithout departing from the scope and spirit of the present inventionclaimed in the appending claims.

1. A video decoding apparatus comprising: an entropy decoding processorconfigured to decode information on a prediction motion vector used toperform inter prediction on a prediction target block among candidateprediction motion vectors comprised in a candidate prediction motionvector list; and a prediction processor configured to generate thecandidate prediction motion vector list by determining information on aplurality of spatial candidate prediction motion vectors from aneighboring prediction block to the prediction target block anddetermining information on a temporal candidate prediction motion vectorbased on the information on the plurality of spatial candidateprediction motion vectors, wherein the information on the spatialcandidate prediction motion vectors comprises at least one of firstspatial candidate prediction motion vector availability information anda first spatial candidate prediction motion vector and at least one ofsecond spatial candidate prediction motion vector availabilityinformation and a second spatial candidate prediction motion vector, theinformation on the temporal candidate prediction motion vector comprisesat least one of temporal candidate prediction motion vector availabilityinformation and the temporal candidate prediction motion vector, and theprediction processor is configured to determines the information on thetemporal candidate prediction motion vector by performing a process ofderiving the information on the temporal candidate prediction motionvector when at least one of the first spatial candidate predictionmotion vector and the second spatial candidate prediction motion vectoris unavailable or when both the first spatial candidate predictionmotion vector and the second spatial candidate prediction motion vectorare available and the first spatial candidate prediction motion vectorand the second spatial candidate prediction motion vector are the sameas each other.
 2. The video decoding apparatus of claim 1, wherein theprediction processor is configured to determine the temporal candidateprediction motion vector availability information such that the temporalcandidate prediction motion vector is unavailable when both the firstspatial candidate prediction motion vector and the second spatialcandidate prediction motion vector are available and the first spatialcandidate prediction motion vector and the second spatial candidateprediction motion vector are different from each other.
 3. The videodecoding apparatus of claim 1, wherein the prediction processor isconfigured to configure the candidate prediction motion vector list tocomprise the first spatial candidate prediction motion vector, when thefirst spatial candidate prediction motion vector is available based onthe first spatial candidate prediction motion vector availabilityinformation, the second spatial candidate prediction motion vector, whenthe second spatial candidate prediction motion vector is available basedon the second spatial candidate prediction motion vector availabilityinformation, and the temporal candidate prediction motion vector, whenthe temporal candidate prediction motion vector is available based onthe temporal candidate prediction motion vector availabilityinformation.
 4. The video decoding apparatus of claim 3, wherein theprediction processor is configured to reconfigure the candidateprediction motion vector list by determining whether a number ofcandidate prediction motion vectors comprised in the candidateprediction motion vector list is smaller than a maximum number ofcandidate prediction motion vectors to be comprised in the candidateprediction motion vector list and adding or removing a candidateprediction motion vector based on a determination result.
 5. The videodecoding apparatus of claim 4, wherein the prediction processor isconfigured to add a zero vector to the candidate prediction motionvector list when the number of candidate prediction motion vectorscomprised in the candidate prediction motion vector list is smaller thanthe maximum number of candidate prediction motion vectors, and remove acandidate prediction motion vector from the candidate prediction motionvector list so that the maximum number of candidate prediction motionvectors are comprised in the candidate prediction motion vector listwhen the number of candidate prediction motion vectors comprised in thecandidate prediction motion vector list is greater than the maximumnumber of candidate prediction motion vectors.
 6. A video decodingmethod comprising: decoding information on a prediction motion vectorused to perform inter prediction on a prediction target block amongcandidate prediction motion vectors comprised in a candidate predictionmotion vector list; and generating the candidate prediction motionvector list by determining information on a plurality of spatialcandidate prediction motion vectors from a neighboring prediction blockto the prediction target block and determining information on a temporalcandidate prediction motion vector based on the information on theplurality of spatial candidate prediction motion vectors, wherein theinformation on the spatial candidate prediction motion vectors comprisesat least one of first spatial candidate prediction motion vectoravailability information and a first spatial candidate prediction motionvector and at least one of second spatial candidate prediction motionvector availability information and a second spatial candidateprediction motion vector, the information on the temporal candidateprediction motion vector comprises at least one of temporal candidateprediction motion vector availability information and the temporalcandidate prediction motion vector, the candidate prediction motionvector list is configured to comprise the first spatial candidateprediction motion vector, when the first spatial candidate predictionmotion vector is available based on the first spatial candidateprediction motion vector availability information, the second spatialcandidate prediction motion vector, when the second spatial candidateprediction motion vector is available based on the second spatialcandidate prediction motion vector availability information, and thetemporal candidate prediction motion vector, when the temporal candidateprediction motion vector is available based on the temporal candidateprediction motion vector availability information, the candidateprediction motion vector list is reconfigured by determining whether anumber of candidate prediction motion vectors comprised in the candidateprediction motion vector list is smaller than a maximum number ofcandidate prediction motion vectors to be comprised in the candidateprediction motion vector list and adding a candidate prediction motionvector based on a determination result, and a zero vector is added tothe candidate prediction motion vector list when the number of candidateprediction motion vectors comprised in the candidate prediction motionvector list is smaller than the maximum number of candidate predictionmotion vectors.